Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » RegExp support
RegExp support [message #2203] Tue, 04 April 2006 00:05 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I was playing around with pcre library, and found out that it provides two matching algorithms:
The NFA algorithm (pcre_exec) doesn't find the longest possible match
The DFA algorithm (pcre_dfa_exec) doesn't support backreferences.
I see it as a drawback that pcre can not simulaneously provide these two features. For example boost regex library is able to do that.
I think this aspect should be taken into account before selecting pcre for integration into U++ library.
Re: RegExp support [message #2205 is a reply to message #2203] Tue, 04 April 2006 00:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
hojtsy wrote on Mon, 03 April 2006 18:05

I was playing around with pcre library, and found out that it provides two matching algorithms:
The NFA algorithm (pcre_exec) doesn't find the longest possible match
The DFA algorithm (pcre_dfa_exec) doesn't support backreferences.
I see it as a drawback that pcre can not simulaneously provide these two features. For example boost regex library is able to do that.
I think this aspect should be taken into account before selecting pcre for integration into U++ library.



Thanks!

Mirek
Re: RegExp support [message #2382 is a reply to message #2205] Mon, 10 April 2006 11:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BTW, right at the moment, RegExes are quite enemy teritory for me.

Perhaps you or somebody else should step in and tried to create the right "plugin" package, ready for subseqent integration with String (WString, maybe even Stream?).

BTW, Stream variant would be usable for String as well via addapting it using StringStream - performance wise, it is quite cheap. But there then remains the unicode problem... maybe use utf-8 only? E.g. in CodeEditor (in TheIDE), all search operations are performed in utf-8 anyway, ditto for files in most cases.

Mirek
Re: RegExp support [message #6281 is a reply to message #2382] Sun, 05 November 2006 19:35 Go to previous messageGo to next message
c420 is currently offline  c420
Messages: 1
Registered: October 2006
Location: Bulgaria
Junior Member
This is simple class that use libpcre, to support Regular Expresion in Upp.
I wrote him to validate some EditFields in my application.
  • Attachment: RegExp.tar.gz
    (Size: 209.03KB, Downloaded 1702 times)
Re: RegExp support [message #6286 is a reply to message #6281] Sun, 05 November 2006 20:57 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I wrote something similar and it's available in uppbox. If you have time please check it. Maybe there is something in my wrapper that isn't in yours (but I doubt it Wink ). Anyway If you could continue your work we could include it in upp as a plugin (pcre is quite good, although some of upp users claim that it lacks some very advanced fetures that are important to them).
Re: RegExp support [message #6296 is a reply to message #6286] Sun, 05 November 2006 23:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Actually, recently I was thinking about this issue - maybe we can use PCRE now and switch to something better later, with the same interface?

Mirek
Re: RegExp support [message #7752 is a reply to message #6296] Fri, 19 January 2007 07:18 Go to previous messageGo to next message
agent86 is currently offline  agent86
Messages: 11
Registered: December 2006
Location: San Francisco
Promising Member
It seems I need/want regular expression capability in theIDE, and offer the following for consideration. I have a public domain implementation which I have been using in my work for awhile now. (excerpt from comments from the file)

* These routines are the PUBLIC DOMAIN equivalents of regex
* routines as found in 4.nBSD UN*X, with minor extensions.
*

and I include the entire set of comments for your review. Note that I made some mildly important additions. I am not an expert in the legalities, etc. but these routines do work. They find the longest match and have back references. See what you think, If you want to take a better look, I'd be happy to contribute them. Just let me know how.

chuck
Re: RegExp support [message #7754 is a reply to message #7752] Fri, 19 January 2007 10:04 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
PCRE RegExp support was added to the library month ago.

BTW, about TheIDE: wildcards are nowhere as powerful as full regular expressions, but for 99% of cases, they are quite handy (and perhaps easier to use).

Mirek

[Updated on: Fri, 19 January 2007 10:07]

Report message to a moderator

Previous Topic: Error in Gccbuilder
Next Topic: Problem with StringReplace [solved]
Goto Forum:
  


Current Time: Fri Apr 26 00:31:41 CEST 2024

Total time taken to generate the page: 0.04054 seconds