Regular Expressions Part 03

Hi All, from two previous posts we talked about regular expressions. From this post I’m going to show you some examples of regular expressions using in the real world. Please refer following twp posts to get an idea about regex if you don’t have,

  1. regex part 01
  2. regex part 02

Let’s see few examples,

  • To match html tags.

htmlTag

  • For a trim function.

trim

trim2

  • To match IP address

ipAddress

  • To match numbers with decimal

floatingPoint

  • To match a date

date

  • To match a line containing a given word

matchContainingLine

  • To match a line not containing a given word

notContainingMatch

  • To match words duplicate near

duplicateNear

For three blog posts we talked about regulal expressions. From previous two posts we learnt regular expressions and from this post we did some examples. So I hope now you have a clear idea about regular expressions. See you soon with another interesting topic. Thank You!

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s