Re: [Lazarus] Regexp syntax

2010-06-16 Thread Juha Manninen
Even better regexp is: ^Tnt(([^L]|L[^X]).*|L$) Thanks. In this case even my original regexp may be good enough. There are always many characters following LX. This was a corner case anyway when trying to convert Tnt* 3rd party components to LCL fall-back components. The fall-back rules

Re: [Lazarus] Regexp syntax

2010-06-16 Thread Henry Vermaak
On 15 June 2010 19:40, Hans-Peter Diettrich drdiettri...@aol.com wrote: Mattias Gaertner schrieb: Even better regexp is: ^Tnt(([^L]|L[^X]).*|L$) I wonder who will be able to understand and update such expressions, at any later time. To me it looks like typical write-only code :-( I'd

[Lazarus] Regexp syntax

2010-06-15 Thread Juha Manninen
Hi any regexp gurus out there? For converter I need a regexp that matches a string starting with Tnt, not followed by LX and captures everything after Tnt. This actually works: ^Tnt([^L][^X].+) but I am sure it could be written in a cleaner way. Then there is another regexp that captures

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Mattias Gaertner
On Tue, 15 Jun 2010 11:12:52 +0300 Juha Manninen juha.manni...@phnet.fi wrote: Hi any regexp gurus out there? For converter I need a regexp that matches a string starting with Tnt, not followed by LX and captures everything after Tnt. This actually works: ^Tnt([^L][^X].+) This would

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Juha Manninen
but I am sure it could be written in a cleaner way. ^Tnt(([^L]|.[^X]).+) Hmmm... It doesn't look very clean. It may be more correct but I am not sure of that. Does [^L]|.[^X] mean: anything but 'L' or anything, followed by anything but 'X' ? Juha --

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Mattias Gaertner
On Tue, 15 Jun 2010 15:21:52 +0300 Juha Manninen juha.manni...@phnet.fi wrote: but I am sure it could be written in a cleaner way. ^Tnt(([^L]|.[^X]).+) Hmmm... It doesn't look very clean. It may be more correct but I am not sure of that. It is not very clean. It does not match TntL

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Graeme Geldenhuys
^Tnt(([^L]|.[^X]).+) Hmmm... It doesn't look very clean. I don't think *any* regex looks clean. ;-) -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ --

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Alexander Klenin
On Tue, Jun 15, 2010 at 23:55, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Tue, 15 Jun 2010 15:21:52 +0300 Juha Manninen juha.manni...@phnet.fi wrote: but I am sure it could be written in a cleaner way. ^Tnt(([^L]|.[^X]).+) Hmmm... It doesn't look very clean. It may be more

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: Even better regexp is: ^Tnt(([^L]|L[^X]).*|L$) I wonder who will be able to understand and update such expressions, at any later time. To me it looks like typical write-only code :-( DoDi -- ___ Lazarus mailing list

Re: [Lazarus] Regexp syntax

2010-06-15 Thread Jürgen Hestermann
Hans-Peter Diettrich schrieb: ^Tnt(([^L]|L[^X]).*|L$) I wonder who will be able to understand and update such expressions, at any later time. To me it looks like typical write-only code :-( Yes, I also never got accustomed to regex syntax. But I know that some are using it frequently.