[TxMt] regex question

Oliver Taylor oliver at ollieman.net
Tue Feb 21 18:50:38 UTC 2006


>> ------------------------
>> ONCE
>> (twice)
>> Three times a lady.
>> Not as much as the Gambler.
>> (This sucks)
>> How would you know?
>> ------------------------
>>
>> How do I match the 2nd line but not the 5th?
>> How do I match the 6th, but not he 3rd?
>
> What is different in each case? The presence of ONCE exactly in the
> line before?
>
> Indeed, I'm uncertain what the logic behind the matches is supposed
> to be. Is the second line matched because of the sequence of cardinal
> numbers, a parenthetical following a line of all capital letters, a
> parenthetical with only one word, a parenthetical with no capitalized
> letters, a parenthetical followed by a statement... and so on.

Yeah, sorry.

Matching the 2nd line (but not the 5th): I want to match any line  
that begins and ends with a parenthetical ... ^\(.*\)$ ... but only  
when the line is directly preceded by a line of all capitol letters,

Matching the 6th (but not the 3rd): Actually, I got this one  
backwards. I want to match the 3rd but not the 6th. So... Any line  
that is directly preceded by the match I described above.

----

I'll check out the IRC channel.

> [1] http://www.geocities.jp/kosako3/oniguruma/

I'll check it out.



More information about the textmate mailing list