Re: Euphoria Regex suggestions

new topic     » goto parent     » topic index » view thread      » older message » newer message
AndySerpa said...

I see that some critical functions have been left out of the Eu version that seriously limit the potential of using the built-in regex in Euphoria. The big one is the lack of support for named subpatterns. To gain all this power only one other function needs to be included from pcre: pcre_get_stringnumber (converts pattern name to pattern number) And there are some other tricks/more power that can be achieved with access to the information pcre provides with its internal function pcre_fullinfo. By adding those two functions to the eu wrapper the usefulness of the regex library could be increased tenfold.

I'll open a feature request for this and try to get it in by 4.0.1

AndySerpa said...

Also helpful would be some other minor tinkering to go along with it to allow more flexible extractions of matches instead of always returning all of them, but that could be done in the eu API as long as you could match names to numbers and have access to the full map that pcre_fullinfo provides (in the case of using duplicate pattern names, you need this to find them all).

The API would need some beefing-up as well, something I could do, at least on the Euphoria side. But I see some API functions are internal (find_replace) which would be beyond my capability. Anyway, I'd like to make a STRONG suggestion that this expanded support be included in a future version as the power of the underlying library is being wasted...

If you can do it in Euphoria and share the code, I can do my best to get that code into std/regex.e

What sort of changes are you suggesting for find_replace() ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu