I want to write a regular expression in a C++ program which checks if a string matches the following expression:
a word not containing '_' but it can contain number followed by
'_' followed by
three digits in a row (i.e. 047)
followed by '_' followed by
a string (can contain anything)
I have tried the following expression but it does seem to find the desired string as described above. I suspect the problem lies in the first part but I cannot detect it in order to modify properly:
static const wregex stringForm("([^_]?)_?(\\d{3})_(.+)");
What is then the proper reg expression?