MATCHES
does not support regular expressions. The documentation says it only takes simple wildcards like .
and *
. If you know your code will always run on Windows, you can use the CLR bridge to run .NET code:
USING System.Text.RegularExpressions.*.
DEF VAR cVariable AS CHAR NO-UNDO INITIAL "cPascalCase".
DEF VAR regexp AS CLASS Regex NO-UNDO.
regexp = NEW Regex("c[A-Z]*").
MESSAGE regexp:IsMatch(cVariable).
FINALLY:
DELETE OBJECT regexp.
END.