Posts

Regular Expressions

 Regular expressions are the combination of wild cards and characters which is used to perform pattern matching. It is string that provides a complex search phrase(is an expression consisting of one or more words.) Uses of Regular expression is Scripting. 1. Test for a pattern withing a string  - To check for existing of substring is a string. For example we can test an input string to see if a telephone number pattern or a credit card number pattern occurs withing the string, it is called data validation. 2. Replace Text  - To find and replace a string with another string. We can use a regular expression to identify specific text in a document and either remove it completely or replace it with other text. 3. Extract a substring from a string based upon a pattern match-  To get a string based on pattern match. we want all the words starting with "A" from a document. In this case we will use regular expression which will create pattern match and will return all w...