#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0

    Combining 2 regular expressions


    Below Regular expession shows only lines that start with ABC

    ^(ABC).*

    Below Regular expession shows only lines that does NOT contain XYZ

    ((?!XYZ).)*

    How do I combine this? So that only lines that start with ABC but does not contain XYZ are showed?
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    How about I tell you to 1) drop the ".*" from the first expression and 2) just combine them like you might expect to?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    How about I tell you to 1) drop the ".*" from the first expression and 2) just combine them like you might expect to?
    Thanks, I did miss the "drop the ".*" " part, that was key.

IMN logo majestic logo threadwatch logo seochat tools logo