Questions tagged [boost-xpressive]

36 questions
1
vote
1 answer

How can I use the "new" operator in a boost::xpressive semantic action?

It seems that boost::xpressive doesn't provide a lazily evaluated version of the new operator, so this semantic action won't compile: using namespace boost::xpressive ; std::vector vec ; // Match any integer and capture into s1. // Then use a…
Stuart Berg
  • 17,026
  • 12
  • 67
  • 99
1
vote
1 answer

Xpressive : much slower regex search when expression is built from sub expression

Using Boost Xpressive (static expression) , I noticed that pattern searching is much slower when the expression is built from sub regexpression. Did I miss something ? or is it inherent with the design ? Xpresive docs…
sandwood
  • 2,038
  • 20
  • 38
1
vote
1 answer

A portable boost.xpressive

I want to use Boost.Xpressive in my C++ homework, and contain it in my source. But the whole boost header file is 70MB+, so is there any standalone xpressive distribution that contains only dependent files?
Siyuan Ren
  • 7,573
  • 6
  • 47
  • 61
1
vote
2 answers

When should I prefer boost::regex ( or boost::xpressive) over boost::algorithm

I thought the boost regex engines would be faster than boost::algorithm This simple test shows algo beating the regex engines by a wide margin This is the entire test program Did I miss something? #include "boost/algorithm/string.hpp" #include…
user754425
  • 437
  • 1
  • 4
  • 10
1
vote
1 answer

Repeat with variable min/max using boost.xpressive

I'm using boost.xpressive static templates to construct regular expressions that are dynamically concatenated into a final expression. The dynamic version has a variable-width repeat, but I do need to use the static constructions due to operating in…
1
vote
0 answers

How to make xpressive engine to act like regular text search

I am using boost xpressive for searching text. I have two search modes. text mode (including wild cards * and ?) regular expression mode For both i am using regex_search(). My question is as follows - In text mode, if my search string is [a-z],…
Revanth
  • 59
  • 8
1
vote
2 answers

Slow performance using boost xpressive

Lately I have being using boost xpressive for parsing files. These files are 10 MB each and there will be several hundred of them to parse. Xpressive is nice to work and clear syntax, but the problems comes with performance. It is incredible how it…
Pablo
  • 557
  • 3
  • 16
1
vote
1 answer

path of regex_byref_matcher.hpp when using xp::sregex::compile

I noticed that when I use xp::sregex::compile in my code, the string ...\3rdparty\boost-1_58\boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp (with my local path) appears in the binary code, compiled in release mods. Is there a way to…
tzviya
  • 537
  • 1
  • 4
  • 14
1
vote
1 answer

wsregex::compile crashes (memory leak) when handling regex string?

I would like to understand why my program crashes when I try to use the wsregex::compile of BOOST with the following…
1
vote
0 answers

Boost Xpressive - why is the failure case of this regex exponential?

I am using a simple regex to match against a string read from the OS that has teh following format: timestamp:{comma separated list of values} Where timestamp is unsigned the values are unsigned To do this I was using the following regex using…
mark
  • 7,381
  • 5
  • 36
  • 61
1
vote
1 answer

Boost::Xpressive compile puzzle under MinGW

Switching to GCC for the first time, and I'm getting a bit confused by what the compiler is telling me here. Essentially, it's behaving like boost::xpressive::wsregex is not defined (I believe). Here is the relevant code: #include…
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
1
vote
2 answers

Using Boost C++ library to do a regex replace with a custom replacement

I can use Xpressive of the Boost library to do some regex replacement like this: #include #include void replace(){ std::string in("a(bc) de(fg)"); sregex re = +_w >> '(' >> (s1= +_w) >> ')'; …
muffel
  • 7,004
  • 8
  • 57
  • 98
1
vote
1 answer

Which Xpressive approach is best to reduce stack usage

I'm using Xpressive extensively in my current embedded C++ project. As I know, Xpressive is a great user of the stack. But are there Xpressive regex approaches that are more stack efficient? E.g. a regex to match a string representing a 32-bit…
GreyMattR
  • 333
  • 2
  • 6
0
votes
3 answers

Tokenize a string excluding delimiters inside quotes

First let me say, I have gone thoroughly through all other solutions to this problem on SO, and although they are very similar, none fully solve my problem. I need a to extract all tokens excluding quotes (for the quoted ones) using boost regex. The…
Spencer Rose
  • 1,190
  • 12
  • 21
0
votes
1 answer

Garbage characters after regex_replace

I am using boost xpressive regex_replace . After the replace I get garbage characters at the end of the string std::wstring wEsc(L"fxSSyrpng"); std::wstring wReplaceByText(L"tiff"); std::wstring searchText(L"fx"); wsregex regExp; try { regExp…
sameer karjatkar
  • 2,017
  • 4
  • 23
  • 43