Xpressive with non char data
Dear all, The new Boost version ships with an extra regular expression library. Now I need a dynamic regualr expression on a std::vectorstd::string. The character type would be a string (since in that case multiple characters are allowed on the same position). Is this possible with xpressive? Boost.Regex didn't seem to support it according to a previous post. wkr, me
gast128 wrote:
Dear all,
The new Boost version ships with an extra regular expression library.
Now I need a dynamic regualr expression on a std::vectorstd::string. The character type would be a string (since in that case multiple characters are allowed on the same position).
Is this possible with xpressive? Boost.Regex didn't seem to support it according to a previous post.
Xpressive can be used with non-char data so long as the data is sufficiently char-like. And string is not sufficiently char-like. You can see the requirements on the character type here: http://boost-sandbox.sourceforge.net/libs/xpressive/doc/html/boost_xpressive... It wouldn't be too hard to loosen xpressive's Char concept to handle this case, but this is the first time someone has asked for it. -- Eric Niebler Boost Consulting www.boost-consulting.com
Eric Niebler
gast128 wrote:
Is this possible with xpressive? Boost.Regex didn't seem to support it according to a previous post.
Xpressive can be used with non-char data so long as the data is sufficiently char-like. And string is not sufficiently char-like. You can see the requirements on the character type here:
sandbox.sourceforge.net/libs/xpressive/doc/html/boost_xpressive/user_s_guide/co ncepts.html
It wouldn't be too hard to loosen xpressive's Char concept to handle this case, but this is the first time someone has asked for it.
Ok thx. I guess then I have to write a simple regular expression engine myself. Basically we need it for (and, or, wildcard, sequence) pattern search between transitions of not mutual exclusive states. The object can be in multiple states at the same time. Therefore I need a character type which can represent multiple states at the same time (for example thus a string). I therefore thought to misuse a regular expression engine. The sequence to be searched for could be "a.+(b|c)" (go from a via anything to state b or c). The object could be in a sequence state "a -> d -> (a&&b)". wkr, me
participants (2)
-
Eric Niebler
-
gast128