-
- Entire line.
^.*$
- Blank lines.
^$
- Whitespace on a line.
\s+
- Whitespace across lines.
(?n\s+)
- Whitespace that spans at least two lines.
(?n\s*?\n\s*)
Note
minimal matching `*?' quantifier
- IP address (not robust.)
(?:\d{1,3}(?:\.\d{1,3}){3})
- Two characters US Postal state abbreviations
(includes territories.)
[ACDF-IK-PR-W][A-Z]
- Web addresses
(?:http://)?www\.\S+
- Case insensitive double words across
line breaks.
(?i(?n<(\S+)\s+\1>))
- Upper case words with possible punctuation.
<[A-Z][^a-z\s]*>
References
An excellent book on the care and feeding
of regular expressions is
"Mastering Regular Expressions"
Jeffrey E. F. Friedl
(c) 1997, O'Reilly & Associates
ISBN 1-56592-257-3
|