Results 1 to 2 of 2

Thread: Regular Expression Help

  1. #1

    Thread Starter
    Fanatic Member bloodsside14's Avatar
    Join Date
    Mar 2009
    Location
    Mid Town of Prontera
    Posts
    527

    Exclamation Regular Expression Help

    I have a simple question i know this is basic but i can't get the right expression.

    Code:
    /^.*:\s+.?.?(one|two).?.?\s*$/i
    That regex can answer this to get the answer "one":
    !@one_!
    My question is if the output is like this

    !@o2ne_1
    What would be my expression to get only the answer "one"?
    How can i disregard the 2 there inside the "one" word.
    ___________________



    Give some REP. if my POST is helpful

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Regular Expression Help

    Either replace all characters that are not alphabets [^a-z&&[^A-Z]], or extract alphabets via capture groups and matcher class.

Posting Permissions

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



Click Here to Expand Forum to Full Width