----------------------------------------------------------------------
--- Knud van Eeden --- 21 November 2009 - 08:56 pm -------------------

Computer: Language: Compiler: C++: Operation: Search: Replace: Expression: Regular: How to create a regular expression using the free Borland C++ command line compiler bcc32 v5.5?

---

The possibility to use regular expressions is default included in the
free Borland C++ v5.5 command line compiler.

In your C++ program, you will have to include the file

 regexp.h

===

Steps: Overview:

 1. -E.g. create the following program:

--- cut here: begin --------------------------------------------------
#include <regexp.h> // #include <iostream> // int main() { // TRegexp Regexp("[0-9]+"); // size_t Len; // size_t Idx = Regexp.find( "This is some text 123 with a number", &Len ); // std::cout << "Your text was found at: " << Idx << ", Length: " << Len << std::endl; // }
--- cut here: end ---------------------------------------------------- 2. -Save this program as --- cut here: begin --------------------------------------------------
c:\temp\yourregularexpression.cpp
--- cut here: end ---------------------------------------------------- 3. -Compile the program --- cut here: begin --------------------------------------------------
C:\Borland\BCC55\Bin\bcc32.exe -Ic:\borland\bcc55\include -Lc:\borland\bcc55\lib c:\temp\yourregularexpression.cpp
--- cut here: end ---------------------------------------------------- 4. -That will show a screen output similar to the following: --- cut here: begin --------------------------------------------------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland c:\temp\yourregularexpression.cpp: Warning W8026 c:\borland\bcc55\include\regexp.h 81: Functions with exception specifications are not expanded inline Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
--- cut here: end ---------------------------------------------------- 5. -Run the created executable program --- cut here: begin --------------------------------------------------
yourregularexpression.exe
--- cut here: end ---------------------------------------------------- 6. -That will show a screen output similar to the following: --- cut here: begin --------------------------------------------------
Your text was found at: 18, Length: 3
--- cut here: end ---------------------------------------------------- === Book: see also: === Diagram: see also: === File: see also: === Help: see also: === Image: see also: === Internet: see also: === http://www.eksperten.dk/spm/563721 === C++: Borland: Compiler: Command: Line: Install: How to install free Borland command line compiler? http://www.knudvaneeden.com/tinyurl.php?urlKey=url000344 --- Computer: Editor: TSE: Search/Replace: Expression: Regular: Can you create a program where you can choose the regular expression operators from a list? http://www.knudvaneeden.com/tinyurl.php?urlKey=url000360 === Podcast: see also: === Screencast: see also: === Table: see also: === Video: see also: --- ----------------------------------------------------------------------