[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Regexp to match any character, including newline?
From: |
Joe Fineman |
Subject: |
Regexp to match any character, including newline? |
Date: |
04 Oct 2003 18:02:06 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
It is sometimes a nuisance that "." in a regexp does not match
newlines. For example, I want a regexp for text in parentheses that
contains the word "and" followed (anywhere) by a date.
(.+ and .+ [1-2][0-9][0-9][0-9].+)
works only if the expression happens to be on one line. I have tried
[^ ] with the space replaced by an unlikely character such as ASCII
000; that seems to work in isolation, but when I substitute it for
. in the above regexp, the result misbehaves, missing all the right
matches & finding the odd wrong one. Is there an obvious solution to
this problem?
--
--- Joe Fineman jcf@TheWorld.com
||: Look on yonder, see that eagle rise. :||
||: He was born on land, but he sure enjoys the skies. :||