Is there a library in the VCL for regular expressions?
If not can you recommend a good third party library.
I am using Delphi 2009
Is there a library in the VCL for regular expressions?
If not can you recommend a good third party library.
I am using Delphi 2009
RegEx is another thing you don't have in Delphi. Perhaps you try the PCRE-based Components for Delphi (didn't test it myself).
I used TRegExp (mentioned by sdu) a few years ago but now the link seems to be dead. Curious...
See TPerlRegEx (download) even though it's only a wrapper around PCRE.
There is not one "in the box", as mentioned by others. However, we need to be careful when we say "can we have regexp in the IDE/VCL", because two different people asking for this may have two very different ideas as to which regexp they want to see supported.
So whilst it might nice to have a form of regexp support "built-in" you have to be aware that this will lead to problems when people start exchanging regexp recipes (with other people not using Delphi) and can't figure out why one person's valid regexp is not a valid regexp in Delphi.
So then it will be "regexp is broken in Delphi" or "why can't we have XYZ regexp support as well as the ABC flavour support?"
So at the moment I'd say having the choice as to which regexp is right for you is in some ways an advantage, assuming you can find a component/library for Delphi which supports that flavour. :)
The regular-expressions.info site also has a page specifically about Delphi support for regexp.
Jedi Code Library(JCL) provides a perl based regular expression. Download JCL from this link.
After install go to installation folder/source/common and you have JclPCRE.pas and pcre.pas
If you are going to use Jedi Code Library(JCL), you will still need to to install a PCRE library.