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

Boost regexp how to parse Cookie string into map?

So Cookie strings look like remixsettings_bits=1; wysiwyg=1,2,3,abc; remixclosed_tabs=0; remixgroup_closed_tabs=786432; remixlang=0; remixchk=5; remixsid=35d4f9907281708019490d07728c27ca5c10e5de7a869c322222225e3219e; audio_vol=100 I wonder how to…
Rella
  • 65,003
  • 109
  • 363
  • 636
3
votes
1 answer

Regex matching url authority parts

I need to match these parts of the following string: (user)@(hostname):(port) User and port can optionally be matched. First I managed it with this regular expression: (?:([^@]*)@)?([^\:]+)(?:\:(\d+))? This matches for foo@bar:80 foo bar 80 But…
reeaal
  • 347
  • 3
  • 14
3
votes
1 answer

recursive boost::xpressive using too much memory

Hi boost::xpressive users, I'm getting a stack overflow error when trying to parse some decision trees with boost::xpressive. It seems to work for trees up to a certain size, but fails on 'big' trees, where 'big' seems to mean around 3000 nodes, and…
3
votes
3 answers

How to save/serialize compiled regular expression (std::regex) to a file?

I'm using from Visal Studio 2010. I understand that when I create regex object then it's compiled. There is no compile method like in other languages and libraries but I thinks that's how it work, am I right? I need to store large amount of…
Mariusz Pawelski
  • 25,983
  • 11
  • 67
  • 80
3
votes
1 answer

c++ Url Parser using boost regex match

how can i parse an url in c++ with boost regex like i have an url http://www.google.co.in/search?h=test&q=examaple i need to split the base url www.google.com and then query path search?h=test&q=examaple
rajesh
  • 83
  • 1
  • 1
  • 3
3
votes
2 answers

Find specific word in reg ex along with special character

string emailBody = " holla holla testing is for NewFinancial History:\"xyz\" dsd NewFinancial History:\"abc\" NewEBTDI$:\"abc\" dsds "; emailBody = string.Join(" ", Regex.Split(emailBody.Trim(), @"(?:\r\n|\n|\r)")); var keys…
Savan Patel
  • 357
  • 4
  • 14
3
votes
1 answer

How to find out if an optional part of a regular expression is captured or not?

Suppose I have this simple regular expression search piece of code: boost::regex re("(\\d+)(/(\\d))?"); boost::smatch matches; boost::regex_search(input_str, matches, re); It searches a string for something like 123/2 or 123. Second digit and /…
s4eed
  • 7,173
  • 9
  • 67
  • 104
3
votes
2 answers

I cannot build boost_regex code because of link erros

I'm trying to use boost_regex on ubuntu 12.04 (gcc 4.8.2). I've installed boost like this. $ sudo apt-get install libboost-all-dev And I've confirmed boost_regex libraries are installed on. $ ls /usr/lib/x86_64-linux-gnu | grep…
jef
  • 3,890
  • 10
  • 42
  • 76
3
votes
1 answer

How do I get the regex matched value using Boost.Regex?

I'm trying to extract the domain from a URL. Following is an example script. #include #include #include int main () { std::string url = "http://mydomain.com/randompage.php"; boost::regex…
rarbox
  • 486
  • 5
  • 14
3
votes
2 answers

How can I convert a Perl regex to work with Boost::Regex?

What is the Boost::Regex equivalent of this Perl regex for words that end with ing or ed or en? /ing$|ed$|en$/ ...
Yadollah
  • 77
  • 8
3
votes
2 answers

getting names subgroups

I am working with the new version of boost 1.42 and I want to use regex with named sub groups. Below an example. std::string line("match this here FIELD=VALUE in the middle"); boost::regex rgx("FIELD=(?\\w+)", boost::regex::perl…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
3
votes
2 answers

Regex to find complex parameters

I am trying to find all the parameteres-values from a string with the following form: pN stands for the Nth parameter: it can be composed of the following chars: letters, numbers, and any char included in kSuportedNamesCharsRegEx vNX for the…
3
votes
1 answer

How to include/link boost::regex library?

I am trying to use the boost regex library but I can't manage to compile my program. All related questions which involve similar error messages seem to relate to situations where regex library wasn't properly linked. I think that I am linking it,…
Leolo
  • 416
  • 1
  • 5
  • 12
3
votes
1 answer

Meta Regex: test if regex is only a string (no regex "wildcards")

I have a (assumed well formed) regex expresion R. I want to test if the regex expression is just a single match (all letters, numbers, and escaped expressions) or could be swapped with anything else. This function, "HasWildCards", would work like…
IdeaHat
  • 7,641
  • 1
  • 22
  • 53
3
votes
1 answer

How can you specify carriage return and newline character match when using boost::regex?

I am having a problem with boost::regex behaviour when it comes to matching \r and \n characters in a string. I am communicating over a serial port with a modem from my linux C++ application and I am receiving the following message from…
mathematician1975
  • 21,161
  • 6
  • 59
  • 101
1 2
3
19 20