Matching character NOT followed by another
Posted: Fri Mar 19, 2010 12:10 pm
This isn't a query related specifically to the regular expression engine in TextPad - I suspect it can't be done in TextPad.
Is there anyway to stop a regular expression match ending either at a specific character or at the end of a line?
For example in the first case I would wish to capture the whole line but in the second stop the match before the first '@' character.
I reckon this requires some form of negative lookahead (?=@) but making this lazy and running to the end of the line without an @ present is testing my tired brain.
Is there anyway to stop a regular expression match ending either at a specific character or at the end of a line?
Code: Select all
- Some Text (19/09/10)
- More Text @home @today
I reckon this requires some form of negative lookahead (?=@) but making this lazy and running to the end of the line without an @ present is testing my tired brain.