How to check boost regex pattern is safe?

D.D.K-2637 966 Reputation points
2021-08-31T20:50:11.467+00:00

Hi,
I'm using following code to split this wstring:

std::wstring inputString{L"#Err | NUM | ABC..."};
boost::algorithm::split_regex(parts, inputString, boost::wregex(L"|"));

This code runs without returning results.

I can't end this loop.

Is there a way to check or stop them in case the user put the wrong pattern?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,970 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.