s***k 发帖数: 23 | 1 【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: stock (Microsoft is dead), 信区: Programming
标 题: Perl for programmers(8): string operation(pattern matching)
发信站: The unknown SPACE (Tue May 23 12:36:16 2000) WWW-POST
Regular expression inherit from command grep in UNIX.
/*/ #matches all characters
/a+/ #matches more than one a
/a?/ #matches 0 or 1 a
/dfj/ #this is a pattern.If the string contains dfj as
a substring, we say
#it matches the pattern
/\b/ #matches a boundary |
|