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

Regex and Boost. Not working on a simple regex

Below is my following code #include #include #include #include using namespace std; using namespace boost; int main() { std::string s = "Hello my name is bob"; boost::regex re("name"); …
Angel.King.47
  • 7,922
  • 14
  • 60
  • 85
0
votes
1 answer

Boost regex linker error with cl 19

I use boost 1.61.0 with cl 19 (visual studio 2015). I built boost libraries from getting start documentation with command line bootstrapand .\b2. This made stage directory with some vc14 prefix libraries. But when I tried to compile getting start…
JalalJaberi
  • 2,417
  • 8
  • 25
  • 41
0
votes
1 answer

How to build boost using VS10

I have an issue with compiling Boost using VC: error: LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_53.lib' The most interesting is that issue is observed only using VC10 compiler. MinGW builds successfully Boost regex. Does anybody know…
Denis Kotov
  • 857
  • 2
  • 10
  • 29
0
votes
0 answers

regex_replace in large string

std/boost regex_replace returns modified string by value. In my case I have to search/replace by regex in a file. I have thousands of files to process and many of them are over 1MB in size. The string to be searched and replaced is rare (e.g. only…
Pavel P
  • 15,789
  • 11
  • 79
  • 128
0
votes
0 answers

Boost C++ Regex Example Compile Error

I'm having an extremely frustrating time trying to get the Boost regex library to behave itself in XCode 8. I've finally managed to sort the includes out, now I'm hitting compiler errors when attempting to run the following regex example from…
DanielH
  • 176
  • 1
  • 16
0
votes
1 answer

Is this c++ template param deduction incorrect?

#include #include int main(void) { std::cmatch cm; std::regex_match("subject", cm, std::regex("(sub)(.*)")); //std::for_each(cm.begin(), cm.end(), [](const std::sub_match &s){ <---- Working statement …
JamesWebbTelescopeAlien
  • 3,547
  • 2
  • 30
  • 51
0
votes
1 answer

Need help with boost regexp library

I'm trying to port a code from PHP to C++. I was using the PHP build-in regular expression to extract some value and it works well. From some reason the same reg expression does not work when using the boot regexp library. Could anyone spot what I'm…
embedded
  • 319
  • 1
  • 6
  • 14
0
votes
2 answers

Simple use of boost::regex match groups

I want to use boost::regex to change the format of a bunch of dates on the format 19991231235959 to this format 1999-12-31_23:59:59 like this: YYYYMMDDhhmmss --> YYYY-MM-DD_hh:mm:ss 19991231235959 --> 1999-12-31_23:59:59 I use this std::string…
Svaberg
  • 1,501
  • 1
  • 19
  • 40
0
votes
0 answers

Regex parttern to validate the host section of url

I am trying to validate the host section of the url, (not the entire url) so in the case of http://www.example.com/some/path, all I want to validate is 'www.example.com'. I have the following regex,…
FFMG
  • 1,208
  • 1
  • 10
  • 24
0
votes
1 answer

What is wrong with this boost c++ regex code?

include #include #include #include #include #include #include using namespace std; using namespace boost; int main() { string…
0
votes
1 answer

boost regex search fails with MFC CString

I having an issue in using Boost regex with a MFC CString. The regex is very simple: it must check if the string ends with the name of a dll I am looking for. In the code below the CString Path DOES contain the dll I am looking for, but I don't…
user311906
  • 1,575
  • 2
  • 14
  • 17
0
votes
1 answer

How to parse escape element '\' and unicode character '\u' using boost regex in C++

I am parsing a text file using boost regex in C++. I am looking for '\' characters from the file. This file also contains some unicode '\u' characters as well. So, is there a way to separate out '\' and '\u' character. Following is content of…
kkard
  • 79
  • 3
  • 10
0
votes
0 answers

Replacing tokens that match pieces of a regex

I would like to use a regex both as a pattern to search and a template to construct a string. (I'm using boost::regex because I'm on gcc 4.8.4 where apparently regex is not fully supported (until 4.9)): That is, I want to construct a regex, pass it…
David Doria
  • 9,873
  • 17
  • 85
  • 147
0
votes
0 answers

unexpected out put from char **name, c

Am in my way to practice how to use the pcre regex library, to match regular expression/pattern against a given data/buffer.Then if there is match, i have to load the matched string to may array/list. but, when i print my list/array (using a for…
kahsay.k
  • 61
  • 7
0
votes
1 answer

Boost.Test Test file content with regular expression

I'm right now implementing a library for exporting data into various formats with a multitude of settings. I'm also using Boost.Test, but there is seemingly no function to test the file contents. For my purposes it should be enough to check if the…
Aleph0
  • 5,816
  • 4
  • 29
  • 80