Posts

Showing posts from April, 2018

Regex basics

Regex or regular expression is a very powerful tool. This tutorial is a very basic tutorial on regex.
Before starting, I like to give some info,
(^) carrot symbol represents start of string and
($) dollar symbol represents end of string Difference between '*' and '+' in regex + means one or more of the previous atom. {1,} * means zero or more. this can match nothing in addition to the characters specified in your square bracket expression {0,}
Difference between '*' and '.*' in regex . means any character. * means previous character (or group) 0 or more times. So .* means any character 0 or more times. That's it * is a quantifier that modifies the meaning of the previous character, group or character class in the regex. On its own it is meaningless. It only carries meaning when combined with what is immediately before it in the regex.
For optional cases, in regex, we use "?" symbol. eg. in email address, special character _ can be use…