1. Regular Expressions

I need to do some 'stuff' using regular expressions.

There seem to be two approaches:

  1. EuRegExp by Christian Cuvier
  2. 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?

new topic     » topic index » view message » categorize

2. Re: Regular Expressions

CraigWelch said...

I need to do some 'stuff' using regular expressions.

There seem to be two approaches:

  1. EuRegExp by Christian Cuvier
  2. 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?

  1. 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.
  2. 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.
  3. wxEuphoria: It's probably overkill, but it also supports regular expressions.
  4. 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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Regular Expressions

Thanks,

I'd kinda overlooked that wxEuphoria supports regex.

It looks like options 2 and 3 are what I should look focus on.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Regular Expressions

mattlewis said...
  1. 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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu