comp • gb.pcre • regexp • notempty

RegExp.NotEmpty (gb.pcre)

Const NotEmpty As Integer = 1024 ' &H400

An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails.

For example, if the pattern a?b? is applied to a string not beginning with "a" or "b", it matches the empty string at the start of the subject. With RegExp.NotEmpty specified, this match is not valid, so PCRE searches further into the string for occurrences of "a" or "b".