...

View Full Version : regualr expression help



jhogeterp
05-23-2005, 02:52 PM
I am fairly new to regular expressions and am wondering how to do what I would assume is a simple expression. Here is what I am looking for the expression to be:

(specific word) followed by (any character) or (line break) followed by (specific word)

is this possible? easy?
any help would be appreciated. thanks!

joh6nn
05-23-2005, 04:05 PM
depends if by "any character" you mean absolutely any character, or anything that's not whitespace. if you mean anything that's not whitespace, it'd be this.
/wordone(\S|\n)wordtwo/

if you meant ANY character, it'd be this:

/wordone(.|\n)wordtwo/

i didn't test those out at all, though, and i freely admit to being incredibly tired at the moment.

jhogeterp
05-23-2005, 04:42 PM
Thanks for your reply. I am not sure if what you recommended would work but this is what I came up:

ANYWORD(.*\s)*NEXTWORD

This seemed to work...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum