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
1
vote
3 answers

Using Regex, how do I extract the numbers from this serial code?

I have over 1,000 serial codes I need to enter into a database but they have to be completely numerical for conversion identification purposes. They all look similar to this format but contain different…
1
vote
0 answers

undefined reference errors when linking the boost regex library with gcc 5.2.0

The below code is compiled successfully with GCC 4.9.2 without any warning: #include #include #include int main() { boost::wregex wregex; std::wstring text = L"foobar"; return boost::regex_match(text,…
1
vote
3 answers

Retaining Text in Find Replace in Sublime Text

I have strings as follows 5V6A 6Q2A 6Q 5Q FA 7A EQ2A 799Q M Y77A279791 V59 2 5A266 Q7Q E7Q 7 7AQ2A 7A29 I identify them using following in Find Option \w.+\d.+(\w+( |$))+ My problem is that I want to replace it with same, but add a "@" symbol…
VIVEK
  • 15
  • 7
1
vote
2 answers

How to match multiple tokens using regular expressions?

I need using regular expressions to match special key and values. There is a special condition that I do not know how to do. The string likes abcd/abcd. I need match all single words before /. So I write (.)*/, and then I found it only match 1 token…
zzy
  • 1,771
  • 1
  • 13
  • 48
1
vote
2 answers

How to replace first occurrence only in vim

Is there any option to replace the first occurrence without asking for confirmation in vim? I want to replace New York with \place{New York} in the first occurrence only without asking for confirmation. I used this code: silent!…
Zam
  • 367
  • 2
  • 17
1
vote
1 answer

boost_regex library not found with CMake

I'm trying to install something (emulationstation modified on a Raspberry 2), which require at some point to use a CMake command that need the Boost library to execute properly. Here is the debug of my command…
Runechronos
  • 41
  • 1
  • 4
1
vote
2 answers

LNK1104 cannot open file libboost_regex-vc100-mt-gd-1_54

I have downloaded the boost library and want to include it in visual c++, but after copying in a piece of example code from the boost website, I get the error "LNK1104 cannot open file 'libboost_regex-vc100-mt-gd-1_54'" The file certainly exists.…
user217339
  • 169
  • 1
  • 2
  • 11
1
vote
1 answer

C++ boost::regex_match gives all NULLs results

I am facing a weird problem which is boost::regex_match gives all NULLs results. Sorry for the bad problem description. Let me copy and paste the code below. I think the boost lib version should be Boost 1-47-0. GCC 4.3.2 on Linux. #include…
jiyi
  • 101
  • 9
1
vote
1 answer

Boost Regex for formatting MAC Address string

I need to format a string that contains a MAC address (for logging). The string is of the format "xxxxxxxxxxxx" and I need to standardize it to "xx-xx-xx-xx-xx-xx". Whats a good regex for this purpose? I'm compiling C++ code using GCC 4.4.7. Also,…
Muru
  • 93
  • 1
  • 1
  • 7
1
vote
1 answer

Regular expression for restricted signed number formats

I want a regex for the following given pattern: {anynumber} will return true. +{anynumber} will return true. -{anynumber} will return false. {anynumber}.5 OR {anynumber}.50 OR {anynumber}.500 and similar pattern will return true (i.e. any number of…
Swarup Saha
  • 895
  • 2
  • 11
  • 23
1
vote
1 answer

Is there a function which searches for an array of words by taking the array as an arbitrary parameter like boost::regex_search in boost library?

I need to implement a search mechanism for a list of words and give the result whether the word is found are not in a text provided. I implemented this using boost library. And it is as follows, int main(int argc, char**argv) { int count = argc…
1
vote
1 answer

unicode regular expressions c++

I want to match the word "février" or any other month by using regular expression. Regular…
Hani Goc
  • 2,371
  • 5
  • 45
  • 89
1
vote
1 answer

boost::sregex_token_iterator not matching valid regex pattern

I have the following string: [A-Z0-9]{6},< ? endrepeat ?>100,USD,Washington No space between < and ? in actual string I am using the following code: boost::regex repeatRegex("<\? repeat min=[0-9]+ max=[0-9]+ \?>(.*)<\?…
Abhijit
  • 13
  • 2
1
vote
1 answer

Statically Linked Boost Regex Not Working

I'm trying to statically link to the boost regex library. I'm using the latest version of boost (1.54) and I can't seem to get it to work. I tried compiling the libraries by first running bootstrap.sh, and then b2 link=static. When compiling my…
Brian Schlenker
  • 4,966
  • 6
  • 31
  • 44
1
vote
1 answer

boost::regex, match_results::operator[] - Mysterious "sub += 2" line

I have an issue accessing sub-matches from boost::match_results class. When I examine the program in debugger, match_results::m_subs array contains exactly what I expect: [0] Is the full match. [1] And further are submatches. They match exactly as…
only_a_ptr
  • 13
  • 2