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

Problem with using Boost::Regex (Console just freezes up)

For some reason boost::regex overloads my application and it freezes without an error, but it compiles fine. For instance this code fails flatly. What am I doing wrong? I updated to boost 1.47 to see if it was a DLL error, but it still doesn't work.…
Speed
  • 1,424
  • 1
  • 16
  • 24
0
votes
3 answers

How to write a regex to match ((11 3) (96 15) (2 3) )

I am trying to make a regular expression that will match: ((11 3) (96 15) (2 3) ) So far I have: ([^(|^)| |[A-Za-z])+ But it only captures the 11 and not the rest. Also the string is a lot longer I just used a small piece of it so it repeats with…
0
votes
1 answer

Boost::regex_iterator constructor fails but make_regex_iterator function succeeds

std::string line; This throws std::runtime_error what(): Memory exhausted: regex_it = boost::sregex_iterator(line.begin(), line.end(), re); This works fine: regex_it = boost::make_regex_iterator(line, re); Does anyone know what is causing the…
Marty B
  • 243
  • 3
  • 10
0
votes
0 answers

How does the "leftmost, longest" rule apply to subexpressions in ERE?

The POSIX standard states that for both ERE and BRE: Consistent with the whole match being the longest of the leftmost matches, each subpattern, from left to right, shall match the longest possible string. For this purpose, a null string shall be…
Mahrud
  • 41
  • 3
0
votes
0 answers

return all possible match for a regex in c++

assume a regex like (a|(?:))(b|(?:))(a|(?:))$ valid results are "a,b,ab,aba". But in the case "a" there are two possible matches, one for the first group and one for the last. Boost regex and std regex will return only one result for input "a". Is…
Markus
  • 373
  • 1
  • 11
0
votes
1 answer

Is symbol ’ special one for boost regexp?

Regular expression: “[^”]*“ String: “lips“ Result: match String: “lips’“ Result: not match I expect both strings to match. C++ code: #include #include #include using namespace std; using namespace boost; int…
Alex
  • 1,047
  • 8
  • 21
0
votes
1 answer

LNK1104 cannot open file 'boost_regex.lib'

I'm currently trying to install a simulation package using Visual Studios 19. When I try to build the solution, I get the error message Error LNK1104 cannot open file 'boost_regex.lib' I am very new to C++ and installing programs from source…
patrick7
  • 366
  • 1
  • 11
0
votes
2 answers

trouble compiling a program using boost regex library

I tried to compile a boost program which was using boost regex library on my linux box. it has all the required headers and libraries. The program refuses to compile throwing a huge dump of template output. I am using the following command to…
Ravikumar Tulugu
  • 1,702
  • 2
  • 18
  • 40
0
votes
1 answer

Regex_replace from boost library doesn't work as expected

I am trying remove a substring following a pattern. I am trying to use the boost library as it provides the regex_replace, which as I understood should replace every occurence of the regex with my given new string. std::string…
Tituuss10
  • 92
  • 10
0
votes
1 answer

Inserting different text to another using Regular Expressions?

I've two text files. I want to take text from first one between tags, and insert it to another text file between {}. Better example (sth like a…
chuguruk
  • 3
  • 2
0
votes
2 answers

how to parse POST body / GET arguments?

So I need to parse such string login=julius&password=zgadnij&otherArg=Value with N args and each arg will have a value. You can find such ti GET arguments and in POST requests. So how to create a parser for such strings using Boost?
Rella
  • 65,003
  • 109
  • 363
  • 636
0
votes
3 answers

RegEx for extracting an attribute value

I am trying to extract the value of id from the code provided below I have tried the following regular expression but it still comes back as my default value of : id_not_found id" selectNOIOrg_do_frm_organization="(.+?)" />
0
votes
2 answers

regex - how to decrement matched digit

I would like to match one digit and later match it again (it can be done using backreferences) but decremented by one. Here is an example regex: "([0-9])abc\\1" Is it somehow possible to decrement by one value from the backreference - \\1 ? Edit I…
Irbis
  • 1,432
  • 1
  • 13
  • 39
0
votes
0 answers

Regex - does "or" require creating groups?

I use boost regex. I have created the following regex witch matches numbers from range [10-31]: [1-2][0-9]|3[0-1] I want to use that regex with additional matching for example: but it doesn't work. It works when I create…
Irbis
  • 1,432
  • 1
  • 13
  • 39
0
votes
1 answer

boost regex - how to match an even number of digits from a range

I would like to match an even number of digits from a range. Here is a regex which match a number of digits from range: boost::regex expr("[0-9]{2,20}"); How to modify that regex to match an even number of digits from a range ?
Irbis
  • 1,432
  • 1
  • 13
  • 39