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?

Developer technologies C++
{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.