# $EPIC: regcomp_cs.txt,v 1.4 2009/03/21 05:49:29 zwhite Exp $
$regcomp_cs(<regex pattern>)
This function compiles a regex into a form suitable for passing to the other regex functions. A regex compiled by this function is case-sensitive.
See the regex page for more info.
A string representation of a regular expression suitable for further use.
@orig_string = "ABC DEF"; @pattern = regcomp_cs(abc); if (regerror($pattern)) { xecho -b Error compiling regex: $regerror($pattern); }; if (regexec($pattern $orig_string) == 0) { xecho -b It matched!; } else { xecho -b Regex error: $regerror($pattern); }; @regfree($pattern);
When run, this will return:
*** Regex error: No match
This function first appeared in epic4-1.029.