Home > code > Cool regex stuff…

Cool regex stuff…

June 28th, 2005 osterday

I was playing around with some regex (regular expression) stuff today and learned about “lookahead” and “lookbehind”.

This expression (?<=\{\{).+(?=\}\}) will return all the characters, numbers and spaces between two curly brackets, but not the brackets themselves.

For example, the string This is {{a test}} of regex returns just a test when the regex is applied.

I also found the Regex Coach which was a great help in debugging the regular expressions.

Categories: code Tags:
  1. jen
    July 5th, 2005 at 16:47 | #1

    You are a big TOOL

Comments are closed.