Site Tools


regcomp_cs

# $EPIC: regcomp_cs.txt,v 1.4 2009/03/21 05:49:29 zwhite Exp $

Synopsis:

$regcomp_cs(<regex pattern>)

Technical:

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.

Returns:

A string representation of a regular expression suitable for further use.

Example:

   @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

History

This function first appeared in epic4-1.029.

regcomp_cs.txt · Last modified: 2009/06/02 15:52 by 127.0.0.1