Questions tagged [boost-regex]

Boost.Regex is a C++ regular expression library with optional Unicode support through ICU.

Boost.Regex is a C++ regular expression library with optional Unicode support through ICU.

296 questions
0
votes
2 answers

Boost ( 1.34) Regex syntax bug

I have read some amount of documentation, and I am more familiar with the current version being shipped with VS2010. But for now I am stuck with ubuntu 8.04, and boost 1.34 and am getting some weird sort of error. Can anybody tell what I am doing…
Egon
  • 3,718
  • 3
  • 34
  • 48
0
votes
3 answers

How get numeric between two character with regex java?

I have the string as follows : SUB8&20.000,-&succes&09/12/18SUB12&100.000,-&failed&07/12/18SUB16&40.000,-&succes&09/12/18 I want to get a string "8&20.000","16&40.000" between SUB and ,-&succes I want to get succes data how to get the string…
Rona Idea
  • 6,734
  • 2
  • 9
  • 12
0
votes
1 answer

How to get particular format through boost::regex

I have a string that is "FA4.6.0.J7_13443_DATA" and want to parse through boost::regex. These are some following use-cases are to be take care of: If first two digit is not "FA" then match failed. After "FA" string always be a numeric value…
0
votes
2 answers

regex_search and regex_replace with Boost

I'm trying to loop among some strings delimited by a '$' pair in a line, replacing each match with a specific value in order to get an output line with all markers replaced but I'm stuck at the second match as I don't know how to concatenate the new…
stack-o-frankie
  • 457
  • 5
  • 15
0
votes
2 answers

Regex tokenizing with Boost only getting last letters of words

I am trying to parse a simple sentence structure with Boost. This is my first time using Boost, so I could be doing this completely wrong. What I want to do is only accept strings in this format: Must start with a letter (case insensitive) May…
beatgammit
  • 19,817
  • 19
  • 86
  • 129
0
votes
2 answers

Unable to find matches using Boost RegEx

I am using boost 1.67.0 regex to find matching filenames in current folder using following snippet boost::filesystem::path p("."); if(is_directory(p)) { for(auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(p),…
raidensan
  • 1,099
  • 13
  • 31
0
votes
2 answers

Regex with BoostRegex C++

Hi i wish to get the values of the following expression : POLYGON(100 20, 30 40, 20 10, 21 21) Searching POLYGON(100 20, 30 40, 20 10, 21 21) When i execute the following code i obtains this result : POLYGON(100 20, 30 40, 20 10, 21 21) result =…
revo
  • 540
  • 1
  • 5
  • 15
0
votes
2 answers

std::regex is much slower than boost::regex on VC2015U3

std::wregex EXCEL_CELL_REGEX(L"=\"(.*)\"", std::regex::optimize); std::wstring text = L"=\"300498\""; for (int i = 0; i < 981 * 6; i++) { std::wsmatch match; std::regex_match(text, match, EXCEL_CELL_REGEX); } Above code takes about 9…
user1633272
  • 2,007
  • 5
  • 25
  • 48
0
votes
0 answers

Boost: How to use \\+ in C POSIX regex interface

I am trying to use BOOST.Regex POSIX Compatible C API's. I am using regcomp() to match an expression like a\+, which should match aa and aaa, while using cflags=REG_BASIC. I have regcomp( reg, "a\\+", REG_BASIC) but it is not working. I found a link…
0
votes
1 answer

Error linking Boost::regex in Android Project (undefined reference) with crystax ndk

I am currently trying to use the boost::regex library in my Android native lib on Android Studio. But I get this two linker errors: F:\Tools\dev\Android\ndks\crystax-ndk-10.3.2/sources/boost/1.64.0/include/boost/regex/v4/regex_search.hpp:56: error:…
0
votes
1 answer

boost::regex search and replace

I'm writing a program that does string manipulations with boost::regex. In all the cases I need the functionality of regex_search, but only specific cases need regex_replace. Is there a way to combine the two so that replacing doesn't redo the work…
SU3
  • 5,064
  • 3
  • 35
  • 66
0
votes
2 answers

Parsing *.cpp file containing enum using boost::regex.

I alredy parsed file and split content to enum or enum classes. std::string sourceString = readFromFile(typesHDestination); boost::smatch xResults; std::string::const_iterator Start = sourceString.cbegin(); std::string::const_iterator End =…
Smit Ycyken
  • 1,189
  • 1
  • 11
  • 25
0
votes
0 answers

compiled Regex template with passing value dynamically

my regex is (\[((?!attr1)[^\]])*\]) and want to make it a compiled template and pass the "attr1" part dynamically. input string root/element1/element2[@attr1='abc']/element3[attr2='xyz']/element4/element5[attr3='pqr']/element6/element7 Want to pass…
user845392
  • 563
  • 2
  • 8
  • 16
0
votes
0 answers

How to read and write a map of string and a structure to a file

The task I tried to accomplish was a set of strings which have to be stored into a std::set and then save it to a file with a number assigned to each set. and I managed to accomplish it by below code using some boost functions void WriteToFile() { …
LearningCpp
  • 972
  • 12
  • 29
0
votes
1 answer

XCode C++: Linker command failed with exit code 1 library not found for -lboost_regex

{There are many possible duplicates for Linker command related problems I read all of them I could find but none helped me so I am posting a new question.} My build is failing with following Linker message: ld: library not found for…
d0mbn00b
  • 5
  • 6