[Lazarus] Regex help needed please

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Aug 10 17:35:08 CEST 2011


On 08/10/2011 05:18 PM, Graeme Geldenhuys wrote:
> 
> The following regex matches the first { symbol up until the last }
> symbol. :-(  I obviously want it to stop at the first } it encounters.
> 
> This is the regex I'm currently using:
> 
>     \s*\{\$.*\}


Ah, I found it. TRegExpr supports the non-greedy syntax, so I changed
the above regex to read:

  \{\$.*?\}


*? makes it non-greedy. :-)



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list