TRegExpr library implements regular expressions in pure Delphi.

Github repo

Now it’s included into Lazarus (Free Pascal).

TRegExpr is easy to use and powerfull tool for sophisticated search and substitutioning and for template-based text checking (especially usefull for user input validation in DBMS and web projects).

You can validate e-mail adresses, extract phone numbers or ZIP-codes from web-pages or documents, search for complex patterns in log files and all You can imagine! Rules (templates) can be changed without Your program recompilation!

As a language for rules used subset of Perl’s regular expressions (regexp).

Full source code included, pure Object Pascal. Thus, You need no DLL! The library source code is compatible with Delphi 2-7, Borland C++ Builder 3-6, Kylix, FreePascal (if You see any incompatibility problems, please. drop the bug-report to author).

Documentation in English, Russian, German, Bulgarian, French and Spanish available at TRegExpr home page

Installation is very simple, the implementation encapsulated completely into class TRegExpr.

Demos projects and usage articles illustrate simplicity and power of text processing with the library.

If You need Unicode (so called ‘WideString’ in Delphi) - see How to use unicode.


Many features suggested and a lot of bugs founded (and even fixed) by TRegExpr’s contributors.

I cannot list here all of them (actually I kept listing only on very early stage of development), but I do appreciate all

bug-reports, features suggestions and questions that I am receiving from You.

  • Guido Muehlwitz - found and fixed ugly bug in big string processing
  • Stephan Klimek - testing in CPPB and suggesting/implementing many features
  • Steve Mudford - implemented Offset parameter
  • Martin Baur ( - German help, usefull suggetions
  • Yury Finkel - implemented UniCode support, found and fixed some bugs
  • Ralf Junker - Implemented some features, many optimization suggestions
  • Simeon Lilov - Bulgarian help
  • Filip Jirsбk and Matthew Winter - help in Implementation non-greedy mode
  • Kit Eason many examples for introduction help section
  • Juergen Schroth - bug hunting and usefull suggestions
  • Martin Ledoux - French help
  • Diego Calp, Argentina -Spanish help

And many others - for big work in bug hunting!

Author Country Review
Passeggieri Filippo Italy I really like TRegExpr!!!! many compliments for that great components! You really did a good job! Many Thanks Andrey.
Hans J. Klarskov Mortensen Denmark I have just stumled into your Regular Expression for Delphi. What a gorgeous find!
Fabian Germany I am using your RegExpr Component for a long time now with pleasure
Sebastian Germany Such good open source thingies must be supported ;-)
Bryan Ashby Thanks for the great code and your help!
Daniele Teti Italy Hi, your is a valuable work. TRegExpr is a great Class...
David Lang Austria I've been using your Delphi regular expressions package, and find it extremely powerful. I thank you for your efforts.
Fernando Leandro Fernandes Brasil I'm very excited for using regular expressions in my projects... it's a very powerful tool
Arjuna Diaz USA I've been using your regexp package in my personal software for a while now, whenever I need broad matching capabilities. Great job! Very easy to use. Also, I used to work at Bell Labs, so I'm a little familiar with stuff.
Martin Barrowcliff USA I have your test-reg exp program. Very nice, you will soon be a top programmer in your country. You are also ex military, as I am.
Craig Manley Netherlands I'm a Perl and Delphi programmer and therefore find your class very useful.
Tom Corcoran I am using your Regular expression unit in Delphi, superb stuff, thank you.
Jelmer Vos Netherlands It is very nice to see that you are still working with TRegExpr. I think it is the best in the world for Delphi. Good work!
Celso Rossi Brasil Im a dephi programmer and find the TRegExpr on the web. It is a Excelent Interface and work Fine !.
Ekki Plicht Germany big thanks for the TRegExp class... it's really fantastic and works very nicely. Good work!
Riccardo Zorn Italy I am using your regexp component and put it on 3 different projects. it's great, congratulations.
Richard well done on the TRegExp package you created. It looks very good !.
Markus Dauberschmidt Germany I started using your TRegExpr unit some days ago to use regular expression string replacements in my application. Let me point out what a powerful class you've written! I'am really impressed Siemens Business Services GmbH & Co. OHG
Udo Weik Germany greetings from Germany! I'm just testing TRegExpr. Thanxs for that wonderful component!
Guru Ramnath Kathiresan I been using your component for the past 10 months and i'm very satisfied withit...
Matthias Fichtner thanks again for your great RegEx implementation. I use it so often, I wouldn't know what to do without it. :)
Damien Mangin France thank's a lot for your amazing work with the TRegExpr library ! I spent hours trying to embed perl into Delphi program (embedded-perl), before trying your implementation, which works just fine !
Bruno Zeitoun France I found your TRegExpr very usefull
Thor Asmund Your implementation is just the right way to do it! I am very pleased that you have taken the time to make the only, I think, regexp component for delphi that supports not only matching but also substitution. I have been using your library in various applicaitons, for instance a GUI Search/Replace tool (that replaces in files in subdirectories) and a homepage image grabber!!
Piero Longhetto Italy i've just finished to download your TRegExp class for delphi and i thing it's very well done.
Craig Peterson We are using RegExpr in the new version of our product, Beyond Compare 2.0 and would be very happy to give you a free license as thanks for your great component.
Martin Fuller UK I have used your TRegExpr to do some simple parsing of Delphi code. Thank you! It is easy to use and your demo application is very helpful. All the expressions I needed worked perfectly.
Tobias Theune Germany i was looking for a regular expression for urls and email and found your routines. its working pretty good
Jelmer Vos Netherlands I just want to say that TRegExpr is great. It is so functional why does Borland put TRegExpr default in Delphi? Is is so cool for a programmer. I do not send such e-mails, but for this I do, because I just want to say thanks! :) And I hope that you are developing TRegExpr in de future so it will even greater and better. If someone ask me for a good RegEx component/unit for Delphi I wil alway give your homepage! :)
John Hocking Thanks for the great component you have provided. I have used version 0.938 with success.
Gerald Nunn Canada I've been looking at your regexp component and it looks very nice.
Sony Arianto Kurniawan Indonesia Thanks for your great regex library for delphi. I'm using it in my application and perhaps i always use it in all of my app ;) Many of my app is get data from internet and parse it, so i think your regexpr is powerful :)))
Jim McKay Oakland, Ca. I just wanted to say thanks. RegExpr is very nice, great help file, great demo. I happy as hell!
Bernie Thank you for the excellent regular expression object for Delphi and Builder. I have compiled and the example in Delphi and enjoyed testing it.
Rendenbach Marc Germany since a few weeks i use your TRegExpr Class for Delphi. Really great stuff
David Gerrald USA Keep Up the good work!
Armando de la Torre thank you for creating such a great library.
Janus N. Tondering DK Your component works great and is easy to use (if you know regexp).
Dave Hughes UK thank you so much for releasing a freeware regular expression library, especially one so feature packed, fast and reliable as this one (I'd written one myself - but it was a bit buggy and used a horribly slow and complicated recursive algorithm - yuck!).
Jeremy Echols I've downloaded and have been using your TRegExpr object, and it's actually working very well. thanks for your great regular expressions class.
Naguschewski Andreas Germany TRegExpr - TREMENDOUSLY INGENIOUS! thx for offering your work for free, man. it's great!
Miroslav Vracevic I think that your TRegExpr is pretty cool!
Aaron Chan Your TRegExpr is great!
Riccardo Zanelli Italy Great stuff this Tregexpr! Do you need an Italian translation of the Help file? I may volounteer...! ;-)
Anatoly Russia Big thank, man!
Dennis Gurock Thank you for TRegExpr. It is very very very usefull :) Keep up the good work.
Andrew Fedorov Russia TRegExpr is very userful component. Thank you.
Peter Furlan Germany Thank you a lot for AudioInfo... it works nice!
Martin Ledoux, Quebec Canada Thank's a lot for this very good class, this is a very usefull and powerfull one. I have big projects with this one. By using this class I think the least I can do is to translate it in french.
shukaiyong China Your TRegExpr is very useful, Thanks.
Kit Eason I'm using TRegExp in a shareware utility I am writing. Many thanks for this brilliant component!
Diego Calp Argentina Your work is excellent, congratulations! I'm working with Excel DDE connection, parsing strings like '[BUDGET.XLS]Main table'!R10C10:R30C12, piece of cake with your library!!
Matthew Winter I have just started to make use of the Regular Expression package, and I have to say. Excellent work.
Kire Mrceski Yugoslavia thanks
Atli Bj�rgvin Oddsson Iceland Like your Delphi Regular expression component a lot! Easy to use and comes with good examples. This should be included with standard Delphi! :)
Rob McCormack Let me say how much I like your TRegExpr. Excellent!
Knud Ole Reffstrup Denmark I am writing you to inform you about the use I have made of your TRegExpr-unit for Delphi. I am a teacher. The Danish teachers in Computer Science have just held their annual meeting, and I held a presentation, where I introduced the subject Regular Expressions with examples from Perl, Delphi (using your unit) and JavaScript. I find your unit very versatile and easy to use. The fact that it is distributed as a unit and not a component to be installed in the Delphi-system makes it particularly attractive.
Dod veryveryvrey nice job !!! :-) Since I discovered Perl, I did a lot of things because of regexp but with no Graphical interface...just batch mode, but now I'll be able to go back to Delphi with that lovely RegExp library, agin many thanx for having making it !
Heikko Webers I like your component !
Jon Smith Finally - I would like to thank you again for a most excellent component! It is truly a joy to use and solves a very troublesome programming problem with ease and elegance.
Edan P. After searching for a good regular expression parser on the net, I came across your component, and was very impressed. It got everything I need, and its just a unit that can easily be added to my project.
Andrew Europe TRegExpr was a first toolkit I used to solve some string handling problems and I found it powerfull enough for that case. Generally TRegExpr is stable and very usefull. Thank you.
Terry Thomas USA Das Vadonia! Sorry, I can't spell in Russian but "Hello" from Atlanta, Georgia in the USA. I am just learning Delphi 3 and am amazed with what you are able to do in a few lines of code! You have a lot of skill and knowledge and I wish you well. Sperseba / Thank You
Ramanujan M.S.S India Thanks for the nice component. It will save hours of coding for searching things out from the strings. Great thought.
Moisey Oysgelt USA I'm evaluating you TregExpr. You did a grate job with this component. Thank you for doing this job.
Simeon Lilov Bulgaria I used TRegExpt to make a DLL and now I use this DLL in Progress 4GL. And it works just fine! I did'n encounter any problems yet. I like TRgExpr very much! You have done great work!
Gerard Cote Canada Hello Andrey, I'm glad to (Virtually) meet you on the net. It's like a great trip for me to the far from America but nevertheless dreamed of Russia ans St-Petersbourg. I found your work very useful to me. I already teached Unix and the Grep like utilities and will undoubtedly find some utility for your Rgrepexe tools as I am learning Delphi to support my back end engine on my new NT Internet Web server, which will be used for teaching support. so I will have to analyse open responses to many exams... and your tool will be welcome then.
Joe Ward I want to say that this is a great library. Thanks!
Basri Thank you for your Delphi implementation of RegExpr. An excellent work.
Yvon Labbee I took your TAudio library it works fine so Thank you.
Zlatka Russia Have downloaded your Regular Expression component. :) It's a perfectly new thing for me :( , but how much easier my work could be if I had had it earlier!
Martin Baur Switzerland Hi Andrey Fine homepage ... nice look ... everything that's needed is there. And of course thank you for your honorable mention of me in your help file ... I was not aware that I did earn this .. :-) Anyway, I was always lurking for some thing like TRegExpr in native Delphi code ... you gave it to us and this is what need some honorable metion.
Stephan Klimek Munic, Germany You did a hell of a job for integrating this little perlish things ;-)
Vlad Russia I try to write this on c many years ago :) but my small attempt forgotten a long time :) thanks for sources and examples :)
chenbm Fuzhou, China Thank Your' regular expressions unit!!