regcomp_cs
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | regcomp_cs [2009/06/02 15:52] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: regcomp_cs.txt, | ||
+ | ======Synopsis: | ||
+ | $[[regcomp_cs]](< | ||
+ | |||
+ | ======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: | ||
+ | |||
+ | < | ||
+ | | ||
+ | | ||
+ | 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); | ||
+ | }; | ||
+ | | ||
+ | </ | ||
+ | |||
+ | 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