Regular Expresions on C++
Hi!
is there such a thing as regular expresions and their evaluations in C++? like finding substrings and all Thanks a lot!! poeta |
Regular expressions are not part of C++ standard. You have to use a library to do any regular expressions magic. Here is one worth taking a look at:
Boost regex library |
There is nothing builtin C/C++ functions or libraries for matching regex offered by ANSI, but you may find lots of libraries on the Internet. Just make a google seasrch ;).
|
Quote:
See "man regcomp". |
thanks a lot !!! I've downloaded Boost Regex and it seems to be working ok........ just a question........... I'm very shy about asking it.... what does it mean when a method has parameters separated by | pipe?
void method (param | param) a really newbie question but I haven't used it before!!! now that I using this regex (I was reading the files it has) and some openGL I noticed this... please help! Thanks |
In c++ the '|' character stands for bitwise inclusive or operator. Its operands can be integral or enumeration types (the usual arithmetic conversions are applied). For example 3 | 5 = 7
To get the result convert the operands to binary form and OR each bit individually: 011 101 ---- 111 Here is C++ code to demonstrate this: Code:
#include<iostream> |
In more practical terms, the | operator is often used to combine boolean options. So foo(X | Y | Z) means call foo with the option X, Y and Z all set. This still works in terms of bitwise OR — the various options are constant integers with all the bits except for a single 1 set to 0.
Alex |
thanks everyone! boost regex works like a charm!! strongly recommended
Thanks |
All times are GMT -5. The time now is 10:58 AM. |