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
2
votes
1 answer

how to enable traces for Boost Regex and Boost Spirit Lex

How can I enable debugging traces for those libraries such as the traces created by Boost Spirit Qi. It would be useful to get some generated XML files which show me the paths of the underlying states.
Baradé
  • 1,290
  • 1
  • 15
  • 35
2
votes
2 answers

How can I find the index in a string that matches a boost regex?

How can I find the index in a string that matches a boost regex?
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
2
votes
2 answers

How to parse an 8-bit hexadecimal number and a string using boost C++?

I have just started using boost C++ libraries for some parser work. I would like to use some help on the following: Matching an 8-bit hexadecimal number. I have tried: char_("0-9a-fA-F") which matches only one hexadecimal digit. I've also tried…
2
votes
1 answer

Boost regex expression capture

My goal is to capture an integer using boost::regex_search. #define BOOST_REGEX_MATCH_EXTRA #include #include int main(int argc, char* argv[]) { std::string tests[4] = { "SomeString #222", "SomeString #1", …
stands2reason
  • 672
  • 2
  • 7
  • 18
2
votes
1 answer

Optimization of the Regex?

Hi guys I am new to the regex for some patterns matching i have wrote the regex but it is very lengthy regex so i was hoping that any one can help me optimize it ? My REGEX--> (T)(\d{9})(T)(\s{0,19}\d{0,19}\s{0,19}[0-9DO ]\d{0,19}\s{0,19}[OD0-9…
user2553512
2
votes
2 answers

How to get array of matches

I'm trying to do something like in the example of boost::regex_serach in here . My sample of code is : boost::regex expression(""); std::string::const_iterator start, end; start =…
2
votes
3 answers

Limiting input data

I am new to regular expressions. I have been reading about regex for last couple of hours to understand how to use regex* to achieve the following, but with not much luck. My brain has started hurting. Hence this call for help. Following are the…
2
votes
2 answers

Normal login regex

I want to check login with regex. Login must contain at least 3-16 characters ({3,16}) Login can contains only alphanumeric, - and _ ([a-zA-Z0-9_-]) Login can NOT contain __, --, -_, _- ((?!--|__|-_|_-)) Login can NOT contain - or _ at the end.…
Shamil Yakupov
  • 5,409
  • 2
  • 16
  • 21
2
votes
0 answers

Error in building boost library for Android framework on Linux

I am facing a problem while building boost library from latest version 1.53.0. While following all steps as described in most of the tutorials for building boost library on Linux system for Android NDK, a weird error is…
upx86
  • 21
  • 4
2
votes
1 answer

Boost.Regex oddity

Does anyone have any idea why the following code would output "no match"? boost::regex r(".*\\."); std::string s("app.test"); if (boost::regex_match(s, r)) std::cout << "match" << std::endl; else std::cout << "no match" <<…
ldx
  • 2,536
  • 2
  • 18
  • 27
2
votes
1 answer

replace string through regex using boost C++

I have string in which tags like this comes(there are multiple such tags) |{{nts|-2605.2348}} I want to use boost regex to remove |{{nts| and }} and replace whole string that i have typed above with -2605.2348 in original string To make it more…
psyche
  • 443
  • 1
  • 5
  • 14
2
votes
1 answer

Extracting sub-string of 4 digit in a line

Trying to figure out how to extract groups of 4 digit using regex The regex I'm using now : regex_time : "(([01][0-9]|2[0-3])[0-5][0-9])"; Code sample: regex expressionFormat(REGEX_TIME); boost::match_results what; if…
Larry Lee
  • 61
  • 1
  • 6
2
votes
1 answer

C++ to convert Boost Regex match result to other format

Possible Duplicate: How to convert a number to string and vice versa in C++ How should I convert the boost::regex match result to other format, like integer with below code? string s = "abc123"; boost::regex expr("(\\s+)(\\d+)"); boost::smatch…
Stan
  • 37,207
  • 50
  • 124
  • 185
2
votes
1 answer

Compilation issue with boost library

I am trying to compile some source codes. However it is throwing some error related to boost library. Here is the error undefined reference to `boost::re_detail::get_mem_block()' main.cpp:(.text+0x40a6): undefined reference to…
rajan sthapit
  • 4,194
  • 10
  • 42
  • 66
1
vote
1 answer

compiling my project with boost::regex linked as static

I am using Boost.Regex in my VC2011 project and the latest Boost.Regex was compiled to a static and dynamic library. I've forced my VC project to link the static library (boost_regex-vc110-mt-1_49.lib), but after the project was compiled and when it…
user1285419
  • 2,183
  • 7
  • 48
  • 70