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
I think you need to use negative lookahead: http://stackoverflow.com/questions/1749437/regular-expression-negative-looka...
(?!%)\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@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@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Ted,
Christian gave you the answer you needed, but in future you may want to consider using stackoverflow.com for this type of general question. It's not that it can't be answered here, or that your question is inappropriate for this forum. It's just that at SO there are so many more people with subject expertise who will see your question, and likely reply within minutes. Cary
Afflictedd2 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