[gnu.g++.lib.bug] Regex problem : matches empty strings

T.Day@ucl-cs.UUCP (11/27/89)

From: Tim Day <T.Day@uk.ac.ucl.cs>

On a Sun-3 (OS4) with ``gcc version 1.36.1 (based on GCC 1.36)''
comparing any empty string with a Regex always seems to evaluate to TRUE.
e.g....

#include <stream.h>
#include <String.h>

main()
{	if (String("").matches(Regex("xxx")))
		cerr << "OOPS!\n";
	else cerr << "OK\n";

	if (String("yyy").matches(Regex("xxx")))
		cerr << "OOPS\n";
	else cerr << "OK\n";

	exit(0);
}

Outputs:
OOPS!
OK