Regular Expressions Part 02

Hi all, from a previous post we talked about regular expressions and get a basic idea about regular expressions. From this post I’m going to look into more about regular expressions.

  • we can use the | to do a selection between multiple criteria. All of them will be chosen as correct results.


  • we can use previously known \b with this | symbol to check only for exact words.


  • ? is having a special meaning where it will be used to make the expression optional.


  • We can use ?? to make first one disable.


  • Also we can use | symbol with the ?. Also here I have used () for grouping.


  • {,} is used to show a repetition limit. First number is the starting point and the second number is the finish point.


  • \1 is the back reference for the capture group one which is grouped by first pair of (). we can reuse the back reference as well.


  • \2 shows the back reference for the second group.


  • We can use what we have learnt up to now to check repeating words.

Screenshot from 2016-07-14 09:46:37

  • We can create a non capturing group as well. These groups will not be captured in backtracking.


So I hope now you have a clear idea about regular expressions. See you soon with another post for regular expressions. Thank You!


One thought on “Regular Expressions Part 02

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s