1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with Regex DOM?

Discussion in 'General Programming Chat' started by ShabbySquire, Dec 20, 2012.

  1. ShabbySquire

    ShabbySquire Power Member

    Joined:
    Nov 30, 2011
    Messages:
    574
    Likes Received:
    122
    Location:
    UK
    I'm hoping someone can help a regex newb.

    I'm looking to escape the word: of
    Also tying to escape a line of (exact) characters: 1 - 30

    I'm not entirely sure if this is viable?
     
  2. handmadebots

    handmadebots Senior Member

    Joined:
    Nov 8, 2012
    Messages:
    905
    Likes Received:
    204
    Home Page:
    What do you mean to escape of ?
     
  3. audioguy

    audioguy Power Member

    Joined:
    Jun 12, 2010
    Messages:
    609
    Likes Received:
    224
    Location:
    Anywhere in the world building WP sites.
    Explain better. I know regex but didn't understand what you said. Too vague.
     
  4. ShabbySquire

    ShabbySquire Power Member

    Joined:
    Nov 30, 2011
    Messages:
    574
    Likes Received:
    122
    Location:
    UK
    No problems. As you know, special characters can be escaped(?) by the \
    I'm hoping to get regex to ignore the actual word: of, and also ignore: 1 - 30

    I'm not sure if this is possible, but I could be wrong!
     
  5. LongBanana

    LongBanana Regular Member

    Joined:
    Oct 23, 2009
    Messages:
    411
    Likes Received:
    247
    Location:
    Chicago, IL
    So, you need to exclude it from your regex search.
    I think this is how you do it:
    Code:
    ^(?!of|[1..30])
    
    That is just my guess of how to exclude the word "of" and numbers 1-30.
     
    • Thanks Thanks x 1
  6. ShabbySquire

    ShabbySquire Power Member

    Joined:
    Nov 30, 2011
    Messages:
    574
    Likes Received:
    122
    Location:
    UK
    Thanks for the regex. Will try it later.