Computer Science Canada

Regex Libraries

Author:  AzureFire [ Thu May 03, 2007 7:41 pm ]
Post subject:  Regex Libraries

Hey guys, I was just wondering what some of you guys thought was the best (and preferably easy to install) library for Regular Expressions.

Thanks for the help!

P.S. I'm using Dev C++ 4.9.9.2, so compatibility might be an issue for those of you that use other compilers/IDEs.

Author:  wtd [ Fri May 04, 2007 1:36 am ]
Post subject:  RE:Regex Libraries

Boost.Regex

Author:  AzureFire [ Sun May 06, 2007 6:49 pm ]
Post subject:  Re: Regex Libraries

Thanks for the reply, though I do have a small problem.

(Problem solved! I needed to use \\[ instead of \[ )

I'm trying to escape the [] characters, but when typed into the IDE and compiled, \[ and \] do not work and I get a warning message ("[Warning] unknown escape sequence '\]'"). The program runs, but does not recognize matches. (I have also tried using \x5B \x5D \N{left-square-bracket} and \N{right-square-bracket}) If however, in the program I have the user type in the exact same expression, it does work.

Any idea what's going on here?

Here's the expression I'm using to test:

^\[(.*)=(.*)\]$

...and I'm trying to match it to:

[item=12]

It works on several online regex testers and a Firefox plugin, just as typed above.

Any help is appreciated.


: