Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » lookahead
Showing page 1 of 2 (19 total posts)
  • Just matching in the middle of a string

    Hello,   I am trying to write a regex to match just with B2 and B3   String content = "aaaaaB1aaaaaXaaaaaB2aaaaaB3aaaaZaaaB4aaaa";   String regex = "(B[\\d]{1}?);    //this group matches with all B1, B2, B3 and B4  I would need to delimit the matching between the 'X' and the ...
    Posted to Construction Advice (Forum) by matias.blasi on January 27, 2010
  • Matching 4 Lines After 1 String to 4 Lines After Another String Dynamically

    I'm trying to create a regex that searches 4 lines after a specific term to make sure it exactly matches the four lines after another specific term. For instance it would search a text for "animals list 1" and take note of the following 4 lines and then search for "animals list 2" and determine if it has the next 4 ...
    Posted to Construction Advice (Forum) by imnsi on December 3, 2009
  • build regex that matches "xyz" in "abcmnbcxyz" (details inside)

    Hi! I need a regexp that does the following: For example we're having a string "abcmnbcxyz"   I need to build a regexp that will find everythig that goes before "z" but not containing "bc" I was trying to use lookups like that one: "(?<!bc).*?z" but it matches whole string. positive ...
    Posted to Construction Advice (Forum) by q-styler on August 12, 2009
  • Help me in writing regular expression

    I have a requirement where I have to fetch prefix in a text excluding right hand side digit pattern. For ex: AB9T0005 should give me only AB9T AB9T-K1A-0005 should give me only AB9T-K1A- What I mean is prefix may include any input including numbers and other alpha numeric values. With out using regular expression I will parse from right ...
    Posted to Construction Advice (Forum) by chambarish on June 17, 2009
  • Need an expression to find all text between numeric identifiers

    Hello, I am using C# in Visual Studio 2008.  I have a text file of the entire Bible that I am wanting to either put into a database or write to an XML document.  The format of the text is as follows with comments in C# single line comment style to the right of the actual text (example: Genesis  //book ...
    Posted to Construction Advice (Forum) by RandyHJ on May 13, 2008
  • Playstation Parsing Problem

    Hello there, I am using PHP, preg_match to pull out of various Auction titles for video games, the video game platform of those games.  I have a list of valid ones and trying to match back to them.  However as this is completely user entered data there is a enormous amount of variety in the titles, which leads to some interesting ...
    Posted to Construction Advice (Forum) by plynam on July 26, 2007
  • Re: help Please !!

    mycotics, may I kindly point out to you post number 29450 in the thread I mentioned? if (preg_match('/^(?=.*bill)(?=.*bob)/', $string)) {     echo "Oh, look! Bill and Bob are finally here! Let's have a party!"; } will do what you want. 
    Posted to Construction Advice (Forum) by eSquire on May 8, 2007
  • Re: Length of an Email

    docdawson:  ^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*){n,20}$ Doesn't this just match n to 20 e-mail addresses? I understand carlosaml wants addresses with no more than 20 characters. The shortest possible address that will match the pattern above has 5 characters (a@b.c). To check for 5 to 20 characters one would have to use a ...
    Posted to Construction Advice (Forum) by eSquire on May 8, 2007
  • Re: Regular Expression that does not equal an input

    Try something along the lines of ^(?!something).*$ Edit: Lyndar was first. Don't forget to escape the user supplied input string. Pattern.quote(String s) will put start and end of line assertions around the string though.
    Posted to Construction Advice (Forum) by eSquire on May 8, 2007
  • Re: Matching text in email header only if one string does NOT match

    Just use something like: ^From:[^<]+<(?!user1@example\.com)(?!user2@example\.org)(?!user3@example\.net).*?^X-Spam-Level:\s*(\S*) with singleline (s) and multiline (m) modifiers (so the dot matches newlines and ^ matches the beginning of each line).
    Posted to Construction Advice (Forum) by eSquire on May 6, 2007
1 2 Next >