[TxMt] Re: Re gular Expression needed

Christian Eager ceager at gmail.com
Fri Sep 17 09:43:13 UTC 2010


I think you need to use negative lookahead:
http://stackoverflow.com/questions/1749437/regular-expression-negative-lookahead

(?!%)\w+\s+\([\w\s]+\)

Matches these:

abc (blah blah blah)
dre (blah blah blah)

But doesn't match this:

dre (blah blah bl%ah)

When testing regexes, I use JSRegexTeststand:
http://rentzsch.github.com/JSRegexTeststand/



On Fri, Sep 17, 2010 at 2:55 AM, Afflictedd2 <flethuseo at gmail.com> wrote:
>
> Hi everyone,
>
> I want to write regular expression that
> allows me to search for things like:
>
> abc (blah blah blah)
> dre (blah blah blah)
>
> but that it only does it if the line does not contain
> a % sign
>
> this is what I have so far:
>
> \w+\s+\(\w+\)
>
> Any help appreciated,
>
> Ted
>
>
>
>
>
> --
> View this message in context: http://old.nabble.com/Regular-Expression-needed-tp29734413p29734413.html
> Sent from the textmate users mailing list archive at Nabble.com.
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate



More information about the textmate mailing list