Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-10

searching regular expression unit

10 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi all,

I'm searching a regular expression unit.

- it must be completely written in pascal and be open source
- it should support most of the 'extended' syntax like: {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... The more the better
- it does not need to be fast

thx in advance for any advice,
Mattias Gaertner

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
Hi all, I'm searching a regular expression unit. - it must be completely written in pascal and be open source - it should support most of the 'extended' syntax like: {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... The more the better - it does not need to be fast thx in advance for any advice,

See the FPC packages, base/regexpr. It's written by Florian Klaempfl. This is on the web-site, BTW :-)

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 19 lines
On Wed, 30 Oct 2002, Mattias Gaertner wrote: > Hi all, > > I'm searching a regular expression unit. > > - it must be completely written in pascal and be open source > - it should support most of the 'extended' syntax like: > {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... > The more the better > - it does not need to be fast > > > thx in advance for any advice, See the FPC packages, base/regexpr. It's written by Florian Klaempfl. This is on the web-site, BTW :-)

I know, but the ToDo list in the unit says:

TODO:
- correct backtracking, for example in (...)*
- | support
- getting substrings and using substrings with \1 etc.
- test ^ and $
- newline handling in DOS?
- locals dependend upper/lowercase routines
- extend the interface

If I find no better unit, I will probably improve this one.

Mattias

Reply by email

Florian Klaempfl
to Mattias Gaertner
you wrote 35 lines
On Wed, 30 Oct 2002 09:15:08 +0100 (W. Europe Standard Time) Michael Van Canneyt wrote: > > > On Wed, 30 Oct 2002, Mattias Gaertner wrote: > > > Hi all, > > > > I'm searching a regular expression unit. > > > > - it must be completely written in pascal and be open source > > - it should support most of the 'extended' syntax like: > > {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... > > The more the better > > - it does not need to be fast > > > > > > thx in advance for any advice, > > See the FPC packages, base/regexpr. It's written by Florian Klaempfl. > This is on the web-site, BTW :-) I know, but the ToDo list in the unit says: TODO: - correct backtracking, for example in (...)* - | support - getting substrings and using substrings with \1 etc. - test ^ and $ - newline handling in DOS? - locals dependend upper/lowercase routines - extend the interface If I find no better unit, I will probably improve this one.

Another option is
http://anso.virtualave.net/delphi_stuff.htm#TRegExpr

But I doubt that 1.0.x will eat it. Even for 1.1 one or two things need a fix.

Reply by email

Mattias Gaertner
to Florian Klaempfl
Show quoted text 42 lines
At 09:55 30.10.2002, you wrote: >On Wed, 30 Oct 2002 09:15:08 +0100 (W. Europe Standard Time) >Michael Van Canneyt wrote: > > > > > > > On Wed, 30 Oct 2002, Mattias Gaertner wrote: > > > > > Hi all, > > > > > > I'm searching a regular expression unit. > > > > > > - it must be completely written in pascal and be open source > > > - it should support most of the 'extended' syntax like: > > > {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... > > > The more the better > > > - it does not need to be fast > > > > > > > > > thx in advance for any advice, > > > > See the FPC packages, base/regexpr. It's written by Florian > > Klaempfl. This is on the web-site, BTW :-) > >I know, but the ToDo list in the unit says: > > TODO: > - correct backtracking, for example in (...)* > - | support > - getting substrings and using substrings with \1 etc. > - test ^ and $ > - newline handling in DOS? > - locals dependend upper/lowercase routines > - extend the interface > >If I find no better unit, I will probably improve this one. Another option is http://anso.virtualave.net/delphi_stuff.htm#TRegExpr But I doubt that 1.0.x will eat it. Even for 1.1 one or two things need a fix.

I downloaded it, changed a few things for mode objfpc 1.0.x and tested some examples successfully.
What will not work?

Mattias

Reply by email

Florian Klaempfl
to Mattias Gaertner
you wrote 49 lines
On Wed, 30 Oct 2002 11:33:15 +0100 Florian Klaempfl wrote: > At 09:55 30.10.2002, you wrote: > >On Wed, 30 Oct 2002 09:15:08 +0100 (W. Europe Standard Time) > >Michael Van Canneyt wrote: > > > > > > > > > > > On Wed, 30 Oct 2002, Mattias Gaertner wrote: > > > > > > > Hi all, > > > > > > > > I'm searching a regular expression unit. > > > > > > > > - it must be completely written in pascal and be open source > > > > - it should support most of the 'extended' syntax like: > > > > {m,n}, |, parenthesis variables, \n, \w, \d, \s, *?, ... > > > > The more the better > > > > - it does not need to be fast > > > > > > > > > > > > thx in advance for any advice, > > > > > > See the FPC packages, base/regexpr. It's written by Florian > > > Klaempfl. This is on the web-site, BTW :-) > > > >I know, but the ToDo list in the unit says: > > > > TODO: > > - correct backtracking, for example in (...)* > > - | support > > - getting substrings and using substrings with \1 etc. > > - test ^ and $ > > - newline handling in DOS? > > - locals dependend upper/lowercase routines > > - extend the interface > > > >If I find no better unit, I will probably improve this one. > > Another option is > http://anso.virtualave.net/delphi_stuff.htm#TRegExpr > > But I doubt that 1.0.x will eat it. Even for 1.1 one or > two things need a fix. I downloaded it, changed a few things for mode objfpc 1.0.x and tested some examples successfully. What will not work?

I don't know :) I just guessed because usually newer Delphi sources doesn't compile
with 1.0.x. If it compiles it should work.

Reply by email

Pierre Muller
to Florian Klaempfl
you wrote 5 lines
At 16:07 30.10.2002, you wrote: >>> >If I find no better unit, I will probably improve this one. BTW: Our regexpr unit should be fixed anyway because the text mode ide uses it too. I can fix it of course.

Support for replacement with groups would be very nice....

Reply by email

Florian Klaempfl
to Pierre Muller
you wrote 9 lines
At 16:13 30/10/2002, you wrote: >At 16:07 30.10.2002, you wrote: >>>> >If I find no better unit, I will probably improve this one. > >BTW: Our regexpr unit should be fixed anyway because the text mode ide uses it too. >I can fix it of course. Support for replacement with groups would be very nice....

You mean the (...) and /1 stuff?

Reply by email

Pierre Muller
to Florian Klaempfl
you wrote 12 lines
At 16:16 30.10.2002, you wrote: >At 16:13 30/10/2002, you wrote: > >At 16:07 30.10.2002, you wrote: > >>>> >If I find no better unit, I will probably improve this one. > > > >BTW: Our regexpr unit should be fixed anyway because the text mode ide > uses it too. > >I can fix it of course. > >Support for replacement with groups would be very nice.... You mean the (...) and /1 stuff?

Isn't it \( pattern \) and \1 ?

Reply by email