mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
handle NULL pointer in regExp
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/libOSspecific.o
|
||||
|
||||
|
||||
@ -76,6 +76,36 @@ int main(int argc, char *argv[])
|
||||
Info << endl;
|
||||
}
|
||||
|
||||
Info<<"test regExp(const char*) ..." << endl;
|
||||
string me("Mark");
|
||||
|
||||
if (regExp("[Mm]ar[ck]").match(me))
|
||||
{
|
||||
Info<< "matched: " << me << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no match" << endl;
|
||||
}
|
||||
|
||||
if (regExp("").match(me))
|
||||
{
|
||||
Info<< "matched: " << me << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no match" << endl;
|
||||
}
|
||||
|
||||
if (regExp(NULL).match(me))
|
||||
{
|
||||
Info<< "matched: " << me << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "no match" << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user