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

Browse by Tags

All Tags » lookbehind » lookahead
  • 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
  • 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: please suggest me the regex for this piece

    This pattern might do what you need.  (?ms)(?<=^(TO|INFO)\s).*?(?=\s+^(?:INFO|GR)\s) It will only work reliably if there are no two other lines starting with TO, INFO or GR in the message body, i.e. after the first GR. It will return one or two matches, depending on the presence of the INFO part.  You will have to split those ...
    Posted to Construction Advice (Forum) by eSquire on May 4, 2007
  • Cannot get lookahead and lookbehind to work

    Hello, I wonder if you can help me, this is driving me crazy! I have a large text file and I want to find a term in it. But... I only want the regex to be successful if this term is NOT encompassed by square brackets. e.g. this is the search term:    sp_W_rev_CreditClient_RMAItems I do not want this to be ...
    Posted to Construction Advice (Forum) by Major Problem on May 2, 2007
  • Look ahead and Look behind

    I've been trying to match the pattern below for about a week and can't seem to get it right. I need to match a specific string that is not hyper-linked or enclosed in brackets.I'm sure the code below won't match what i need. It's simply to illustrate what i'm aiming to accomplish: [^\{] word here[^\} ]  Any ...
    Posted to Construction Advice (Forum) by emarket78 on March 31, 2007
  • Re: Detect content of tags

    Ok, so you will not be using groups. In that case you can use lookahead and lookbehind with this regular expression. (?<=((<[^>]*>)[^<>/]*))(padding)(?=([^<>/]*(</[^>]*>))) It will let you replace the word specified in the middle. Brendan 
    Posted to Construction Advice (Forum) by Brendan on March 7, 2007