K
K
Kirill H2018-02-21 19:20:14
Regular Expressions
Kirill H, 2018-02-21 19:20:14

How to get value from string by REGEX in C++0x?

Hello everyone, I'm figuring out the regex library that was added to 0x. Tell me, who came across how it is possible to get text from a string using a pattern like regex with regex resources:
regex:

<LanguageName lang="[a-z]{3,3}">[a-z]{0,50}<End of block>

text:
<LanguageName lang="eng">Some text on English.<End of block>

At the output, I want to get a list of parameters:
"eng", "Some text on English".

I just gave an example, I'm interested in an abstract solution, so that after applying regex to a string, you can get a collection of values ​​​​from it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill H, 2018-02-22
@KirillHelm

Found a solution for C++. This is an iterator, a regular expression is passed to it, and when operator++, it will jump to the next matching regular expression in the line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question