[TxMt] Re: Conditional regex

Dijk van Marc marcvdijk at gmail.com
Wed May 27 14:30:02 UTC 2009


> his indeed works but I do think I need to be a bit more specific.
> Lets look again at the line:
>
> ATOM     14  CA  GLN A   2     -27.648  -9.581  30.325  1.00 10.00
>
> My goal is to have both the 'ATOM' string and the 'GLN' string colored
> differently.
>
> Using ^(ATOM|HETATM)\b I can color the ATOM part.
> Using \bGLN\b I can color the GLN part.
>
> The problem is that I only want the GLN part to be colored if the line
> starts with ATOM. In your reply the complete part starting with ATOM
> up to GLN gets colored.
>
> Marc

Dear all,

Thanks for all comments and tips on my "Conditional regex" question.
Nevertheless I'm still a bit of a novice when it deals with regular  
expressions.
Although I can see the logic in many of your tips I'm still unable to  
put the
bits and pieced together into a functional  expression.

Would anyone of you be so kind to provide me with a more elaborate
answer/example?

Thanks,

Marc




More information about the textmate mailing list