Curious of anyone knows of an easy, quick way to do regular expressions using UnicodeString
in C++ Builder 2009
.
Particularly for an IPv4 IP address.
Curious of anyone knows of an easy, quick way to do regular expressions using UnicodeString
in C++ Builder 2009
.
Particularly for an IPv4 IP address.
Use DEELX Regular Expression Engine, I have written a BCB wrapper for it and downloadable from here (Independent single header).
char *text = "My ip is 212.122.090.180";
TMatchResult result;
TRegex <char> regex("\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b", IGNORECASE);
result = regex.Match(text, 0);
if(result.isMatched())
printf("Found at %i-%i", result.start, result.length);
else
printf("Not found.");