Jacek Sieka writes:
> So, all of you regex freaks out there, which regex library to use?
> There's a plethora of them out there, all with (slightly) different
> syntax...obviously, in the end, it would be useful for all clients
> that support regex to support the same regex?
While I do like perl regexes (of course...), I'd say that POSIX
extended regexes probably is the best option. I say that because it is
a specified standard, and thus, unlike perl REs, it doesn't lock you
to a specific implementation, but there are several to choose
from. For example, I'm fairly sure that the "RX" package from
gnuwin32.sf.net implements POSIX extended REs. It's also the standard
behavior of glibc on GNU systems (provided that you give the
REG_EXTENDED flag). POSIX extended REs also do contain almost all
features you'd ever want.
If you want to review it, its syntax is given in the regex(7)
manpage. For those of you on a Windows system, I have made it
available in HTML format here:
Also, if you want the most commonly used stuff from the perl-style
REs (like \s and \w and so on), it's fairly easy to make the client
translate it into bracket expressions.