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

ReplaceRegex Function not doing the job

I want to edit this line of input and add some more values to the Product_A Key. input="CSDT_FLAG_PRODUCT_FF_FWUIDS=Product_A:45223423;Product_PD:4;Product_CD:345345,22454;Product_F:3423" I have the below ant replaceregex line. replaceregexp…
CodeGeek123
  • 4,341
  • 8
  • 50
  • 79
0
votes
1 answer

Using boost to extract content from a string

I had recently written regexes to parse contens in my file but that one was in .NET and I just started using Boost now for my C++ project. I have a line similar to the following, which is a std::string 123 12 E that I have to parse and get the…
user1240679
  • 6,829
  • 17
  • 60
  • 89
0
votes
1 answer

what does this convoluted regex do

I came across the following regex at work. What does it do? ,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\")) To understand it, I split it into following parts , = Match everything that has , (?= = Followed by (?:[^\"]*\"[^\"]*\")* = Anything which does not…
Jimm
  • 8,165
  • 16
  • 69
  • 118
0
votes
1 answer

Boost regex not matching "\\s" to spaces

I'm just starting out with boost and c++ and I'm struggling to understand the behaviour of boost's regular expression engine when it comes to matching whitespace. If I use the code: boost::regex rx(" "); cout << regex_search(" ", rx); to match…
ndawson
  • 253
  • 4
  • 9
0
votes
5 answers

Regex required for space delimited strings java

I have an operation that deals with many space delimited strings, I am looking for a regex for the String matches function which will trigger pass if first two strings before first space starts with capital letters and will return false if they are…
Avishek
  • 390
  • 4
  • 22
0
votes
1 answer

Boost regex on windows C++ code::blocks

I want to use boost regex in c++ on code::blocks on windows. I compile a simple program which uses the instruction regex pat( "^Subject: (Re: |Aw: )*(.*)" ); and it doesn't work, I get errors like:…
shn
  • 5,116
  • 9
  • 34
  • 62
0
votes
1 answer

How to stop the format ($) for boost::regex_replace in C++?

I'm using boost::regex_replace(replacement_text, regex, new_text) function to do this... replacement_text = "{replace_me}" regex = "(\{([^\}]*[^\s]*)\})" new_text = "$$$" For every new_text that doesn't contain "$", this works beautifully,…
unwise guy
  • 1,048
  • 8
  • 18
  • 27
0
votes
2 answers

Issues compiling boost programs using cygwin

UPDATE: Found a way to make it compile, see below. Hello, I'm having issues compiling boost programs under cygwin. I've installed the default boost and g++ packages from the cygwin project's setup.exe. On my Linux systems, I can compile a program…
thras
  • 21
  • 3
0
votes
1 answer

C++ boost.regex number of repetitions specified in the string

Suppose I wanted to create a boost.regex expression that would match strings such as "repetitions: 5 aaaaa" "repetitions: 3 aaa" Is there a way to do this with boost?
Kvothe
  • 467
  • 4
  • 13
0
votes
1 answer

Named Subexpressions error in Boost Regex

I'm trying to use named subexpressions to replace multiple patterns in the input string using boost::regex_replace and named subexpressions. I use the following code: std::string s="Sun Fun Gun Tic Tac Toe ;$!"; boost::regex…
Mindstorm
  • 443
  • 1
  • 5
  • 12
0
votes
0 answers

How do I write Regex for a SublimeText2 snippet that does both a replace and a slice?

I've been looking at making more snippets for Sublimetext2. I've been looking at http://sublimetext.info/docs/en/extensibility/snippets.html and other questions here and I was able to write this snippet to get the name of the file as a function…
Soesah
  • 155
  • 2
  • 10
0
votes
1 answer

How to search for a regular expression in c++?

I'm working on C++, I need to search for a given regular expression in given string. Please provide me the pointer to do it. I tried to use boost::regex library. Following is the regular expression: regular expression to search : "get*" And above…
BSalunke
  • 11,499
  • 8
  • 34
  • 68
0
votes
1 answer

Replace all matches in 1 iteration using regular expressions

Is it possible to search different patterns and replace the matchings in 1 iteration? For example, if I have the string "Hey {Apple}, where is {Carrots|Peas|Cucumber}?" Is it possible to replace everything inside the curly braces in 1 iteration so…
unwise guy
  • 1,048
  • 8
  • 18
  • 27
0
votes
1 answer

Regular expressions in C++

Right now I have two regular expressions that does this: Regex-1 = "(\\{(\\w+)\\})"; Regex-2 = "(\\{([^\\|]*)\\|([^\\|]*)\\|([^\\|]*)\\})"; I just want to be able to combine the two Regex into one, so that which ever Regex searches first will be…
unwise guy
  • 1,048
  • 8
  • 18
  • 27
0
votes
1 answer

regex_search matching unspecified text

I've been using Boost::regex and Boost::regex_search and found that when I run the regex \\<(\\w+\\-?\\w+)\\> These all get matched like normal BitcoinicaHacker> Who wants free bitcoins courtesy of bitcoinica? who…
trippedoutfish
  • 357
  • 1
  • 4
  • 8
1 2 3
19
20