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

How to print value in boost::u32regex & reg

I want to print a value in boost::u32regex & reg using std::cout. For boost::regex & reg, I can print reg.str() but not able to use str() to boost::u32regex. Can anyone please tell me ?
Rayappan A
  • 49
  • 1
  • 5
0
votes
2 answers

Strange results with Boost::regex

I was playing around with Boost::regex and this is the first time I'm working with regex as well as Boost, so forgive me if the question is really stupid. I am getting a NO_MATCH with the following values: actual_name = "q\[0\]123" user_name =…
Jatin Ganhotra
  • 6,825
  • 6
  • 48
  • 71
0
votes
1 answer

How to use boost regex with qt creator and msvc

I had VS 2010 installed already installed in my system. So when i downloaded QT (I have to use QT as thats what the project req was in) ,i used this link and installed it. It was able to auto detect the visual C++ compilers and was working fine. Now…
Sayok88
  • 2,038
  • 1
  • 14
  • 22
0
votes
2 answers

how to define a regular expression in boost?

I have a section in file: [Source] [Source.Ia32] [Source.Ia64] I have created the expression as: const boost::regex source_line_pattern ("(Sources)(.*?)"); Now, I am trying to match the string, but I am not able to match; it is always returning…
user1553605
  • 1,333
  • 5
  • 24
  • 42
0
votes
1 answer

Boost::Regex DOTALL flag

Is there a DOTALL matching flag for boost::regex? The documentation shows: static const match_flag_type match_not_dot_newline; static const match_flag_type match_not_dot_null; but no mention of regular DOTALL. I'm trying to match a python regular…
whatWhat
  • 3,987
  • 7
  • 37
  • 44
0
votes
1 answer

Regex for taking class name from string

I have string like this one: parser = new ASTParser(in, encoding); After i tokenize those string I get: ASTParser(in, encoding); Now, how can I perform regex to get only ASTParser? I tried to do this using std::erase: …
chao
  • 1,893
  • 2
  • 23
  • 27
0
votes
1 answer

make can't find regex.hpp (boost)

I'm trying to compile a small c++ project with one file only. The 5 first lines of BoostRegex.cpp are: #include #include #include int main() { .... I run the following ./configure line (it's a cross compile): cmake…
Vitor Carvalho
  • 335
  • 1
  • 5
  • 11
0
votes
1 answer

Why doesn't g++ see boost::regex_search() function?

I am trying to compile against the boost::regex library, but as soon as I try and use the regex_search() function, it barfs: $ g++ -Wall -L/cygdrive/c/Users/Adrian/Downloads/boost_1_53_0/stage/lib -std=c++0x exec.cpp -lboost_regex -o exec exec.cpp:…
Adrian
  • 10,246
  • 4
  • 44
  • 110
0
votes
2 answers

C++ boost/regex regex_search

Consider the following string content: string content = "{'name':'Fantastic gloves','description':'Theese gloves will fit any time period.','current':{'trend':'high','price':'47.1000'}"; I have never used regex_search and I have been searching…
dusz
  • 913
  • 1
  • 9
  • 15
0
votes
1 answer

TextMate Snippet to Mirror Only Matched Characters

I have been trying unsuccessfully to mirror text that only matches "a-z0-9" using the following code: ${1/[a-z]/$0/}${1} After the snippet has been tab triggered I would expect to type "$test" and see "test" mirrored. Any clues? Many thanks!
Chris Kempson
  • 319
  • 1
  • 3
  • 13
0
votes
1 answer

Combining two regular expressions in boost regex

I have two regular expressions which looks up a url and determines if the URL is a silverlight video url URL should have at least one of these extensions any where .isma, .ismv, .isml Regex: .ism(a|v|l) and URL should have the string…
Santhosh
  • 891
  • 3
  • 12
  • 31
0
votes
1 answer

Error recovering values from boost::unordered::unordered_map using std::string keys

I'm storing in an unordered_map the results I get from a regex match. std::cout the sub matches m[1].str() and m[2].str() shows the pair key-value correctly. Although when I store them in an unordered_map I always get an exception reporting that…
Adrián Pérez
  • 2,186
  • 4
  • 21
  • 33
0
votes
4 answers

Regex Lookbehind assertion - match link anchor text

I have links like Now I want to match only anchor text using regex. I mean it should match only Text Google in…
PrivateUser
  • 4,474
  • 12
  • 61
  • 94
0
votes
2 answers

Extracting quoted and unquoted values using regex

I'm trying to to parse a string of type = using regular expressions but have hit some issues adding support for quoted values. The idea is that any unquoted values should be trimmed of leading / trailing white space so that [ Hello ]…
Component 10
  • 10,247
  • 7
  • 47
  • 64
0
votes
1 answer

Smarter way to use regex to convert list of addresses

I don't know enough about regex to come up with a smarter way to turn a list of addresses from blocks into single lines. Here's an example: @sdfqsdf qsdfqdsf USA @sdfqsdf qsdfqdsf USA etc. I currently use the brain-dead regex: SEARCH…
Gulbahar
  • 5,343
  • 20
  • 70
  • 93