Regular Expression: Lookahead and Lookbehind

Ever wonder what this regular expression means? “^(?<=PO)abc$”, the parenthesis in the beginning is the “positive lookbehind” as per symble less than. It pretty much check any characters before “abc” that has to equal to “PO” otherwise any expression wont happen. It is like a STOP to the expression and fails if it doesn’t match.

For more information check this link:

And also a thorough explanation happening under the hood, this is a good explanation as you follow the paragraph:

If you are wondering whether you can put it in any order, yes you can but an explanation is below:

Leave a Reply

Your email address will not be published. Required fields are marked *