ls -l ${re g '\.(sbl|dis)$' *}
Break string up into its constituent characters, putting the result in shell variable x:
x = ${re mg '.|\n' string}
Quote a string s so that it can be used as a literal regular expression without worrying about metacharacters:
s = ${re sg '[*|[\\+.^$()?]' '\\\0' $s}
Define a substitution function pat2regexp to convert shell-style patterns into equivalent regular expressions (e.g. ``?.sbl*'' would become ``^.\.sbl.*$''):
load std
subfn pat2regexp {
result = '^' ^ ${re sg '\*' '.*'
${re sg '?' '.'
${re sg '[()+\\.^$|]' '\\\0' $*}
}
} ^ '$'
}
| SH-REGEX(1 ) | Rev: Thu Feb 15 14:42:47 GMT 2007 |