Regular Expression

A regular expression is a system used in programming for pattern matching. 
It could be used to text search and replacing. 

/./ Matche each and every single character

/\d+/ Matche any kind of digit one or more

/\w/ Matche anything a-z, 0-9, _

/\s/ Matche every space

/[a-z]+[3-9]+/ Character Set for matching

/(\.in)?/ Basically it's for optional. Question mark to check whether 
it is or not of the preceding token

Look Around:
? mark is not going to include in the result
= sign is going to match
! sign is not going to match

	example: Lookbehind
		price is $500
		price is €600
		(?<=€)   Positive Lookbehind
		(?<![$]) Negative Lookbehind
	example: Lookahead
		(?=\.com) Positive Lookahead
		(?!\.com) Negative Lookahead

/com$/    $ match at last of the line
/^com/    ^ match at starting point of the line
/com\b/   b/ boundary of the line. it's serach for starting and the end


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