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
2 answers

Regex for PHP. Search for words and return data after the words

I'm trying to make a regex for a work I've been asked to but I'm having no luck making it efficient enough. The objective is to make the following as efficient as it can be. Objective number 1. Separate all text using the sentence endings (dot, 3…
brunoais
  • 6,258
  • 8
  • 39
  • 59
1
vote
2 answers

Searching using regular expressions C++

I'm using Boost.Regex to achieve something like this: search for a "|" and then take the left part of the "|" and put it a string, same with the right part: string s1; string s2; who | sort After this s1 should be "who" and s2 shoudl be "sort". If…
Adrian
  • 19,440
  • 34
  • 112
  • 219
1
vote
0 answers

Building Boost 1.70.0 with icu 64.2

I have built icu 64.2 (debug and release for both x86 and x64). My build passes all the tests, so I know icu is not the issue. I have also built a 64-bit version of boost 1.70.0 using the following b2 build command: b2 address-model=64…
1
vote
1 answer

Unexpected output while getting the name of a file with some regex from a directory using boost::regex

I just made a function findFile to find whether a file with some pattern file_name_regex in the directory dir_name. Just test it in Coliru #include #include #include #include namespace fs…
leiyc
  • 903
  • 11
  • 23
1
vote
0 answers

Boost::regex with ICU does not work with named sub-expressions?

Are named subexpressions supposed to be working with regex ICU wrappers? It looks like they are not. For example the code: boost::u32regex someRegex = boost::make_u32regex( "(?.*)$" ); boost::match_results
zzz
  • 356
  • 4
  • 9
1
vote
1 answer

Boost regex is not matching the same as several regex websites

I am attempting to parse a string using regex, so that when I iterate over its matches, it will give me only the results. My goal is to find all #include #include "stuff.h" while ignoring them if they are part of a comment block such…
Anton
  • 340
  • 1
  • 5
  • 15
1
vote
1 answer

Why regex_match do not match my regex?

I have to write a C++ regex but i am not able to get correct result on regex_match as i am new to c++. The string for testing is: D10A7; Lets say unsigned_char[] stringToBeTested="D10A7"; What i have to do is after regex_match i will extract 10 and…
1
vote
1 answer

how to join keys and values of a map using boost especially if the value is a structure

In the below code aim traversing through the map separately and fetching keys and values , Is there a way that i could do it per entry not separately i need to join key and its value (which is a structure here ) #include…
LearningCpp
  • 972
  • 12
  • 29
1
vote
1 answer

Extracting substrings using Boost::Regex from textfile

So I have emails in many different text files, and I need to extract them from said files, which are not consistent in layout. I'm using Boost::Regex and Boost::File-system to try and read them, and then extract the email address. However it doesn't…
Rivasa
  • 6,510
  • 3
  • 35
  • 64
1
vote
1 answer

How can I use boost::regex on a boost::circular buffer?

I'm capturing data in a boost::circular_buffer and would like to now perform a regex search on the contents but I'm having some difficulty getting boost::regex to understand how to look at the buffer. Here's a stripped down version of the sort of…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
1
vote
1 answer

Regex matching groups boost c++

[Noob Corner] Hello, I'm trying to catch a group with boost regex depending on the string that matched and I think I'm using a wrong way. boost::regex expr(R"(:?(:?\busername *(\S*))|(:?\bserver *(\S*))|(:?\bpassword…
Wimps
  • 359
  • 1
  • 3
  • 11
1
vote
1 answer

Strip emojis from Telegram bot update

I want to remove the emojis from a json Telegram bot update parsed with boost property tree I tried to use the regex pattern from this answer and a few others but I'm not sure how to get them to work in C++ (the below causes a…
JFB
  • 13
  • 4
1
vote
2 answers

C++11 execute block in same thread but with timeout

Lets say we have block of code, we just cant modify it, but we want to break it, exit this piece of code when it runs too long (x miliseconds) Pseudo code Throw exception after (500ms) { auto result = Do some risky job, for example test string…
ElSajko
  • 1,612
  • 3
  • 17
  • 37
1
vote
1 answer

Boost regex throws complexity exception while std::regex does not

I've faced a weird problem - the library I use uses regular expressions, which can be either boost or std, depending on options provided during configuration. Due to other reasons, I can't use std::regex in my code and use boost instead. When I…
peetonn
  • 2,942
  • 4
  • 32
  • 49
1
vote
0 answers

In a Sublime Text 2 snippet, how do I transform a user entered parameter ${1:Param/^\w/\u$&/}?

I am trying to make a ST2 snippet to insert a comment "section" in my PHP code. I am attempting to achieve something like the following: // -------------------------------------------------- // ${1:Enter section title here/^(.*)$/\U\1/} //…
niebaum
  • 11
  • 1