1. Regular Expressions
- Posted by CraigWelch Feb 04, 2009
- 931 views
I need to do some 'stuff' using regular expressions.
There seem to be two approaches:
- EuRegExp by Christian Cuvier
- A PCRE wrapper by Karl Bochert. Labelled as 'Windows', but PCRE is common on Linux so I assume it would work.
Has anyone used both, such that they could comment on the relative merits?
2. Re: Regular Expressions
- Posted by mattlewis (admin) Feb 04, 2009
- 926 views
I need to do some 'stuff' using regular expressions.
There seem to be two approaches:
- EuRegExp by Christian Cuvier
- A PCRE wrapper by Karl Bochert. Labelled as 'Windows', but PCRE is common on Linux so I assume it would work.
Has anyone used both, such that they could comment on the relative merits?
- EuRegExp: Unfortunately, doesn't work. At least, the latest version posted on the web, 0.91, has errors just parsing. I never got past that to see how the regex stuff actually performed.
- PCRE: You might need to change the open_dll()/define_c_* imports to get it working on Linux. But probably not difficult to get working.
- wxEuphoria: It's probably overkill, but it also supports regular expressions.
- Euphoria 4.0: Natively supports regular expressions. It's not ready for use in a production environment, but if you're just doing some one-off data munging, it would probably be fine.
Matt
3. Re: Regular Expressions
- Posted by CraigWelch Feb 04, 2009
- 963 views
Thanks,
I'd kinda overlooked that wxEuphoria supports regex.
It looks like options 2 and 3 are what I should look focus on.
4. Re: Regular Expressions
- Posted by CraigWelch Feb 05, 2009
- 901 views
- Last edited Feb 06, 2009
- PCRE: You might need to change the open_dll()/define_c_* imports to get it working on Linux. But probably not difficult to get working.
Working fine, it wasn't too hard. The .dll functions used in the old package were undocumented, and don't appear in the .so on my Linux system, which is a recent version. Not difficult to get the current functions from the .h file and change regex.e to suit.
On a typical web-scraping application, where I've written my own specific strip_the_tags and find_the_expression routines, I've replaced some of that with regular expression finds. It's much faster.
I'll send the regex.e to anyone who wants to use PCRE on Linux.