Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    regualr expression help

    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!

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Sep 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •