Posts

Showing posts from June, 2016

Regex from Basics

To match a specific string say tutsonly, the regex for this is "tutsonly" without quotes. To match any character except newline use a dot ( . ) i.e for xxx.xxx.xxx where x can b any character use ...\\....\\....\\. as regex code. where \\. is used for dot and ( . ) for any character. The expression \d matches any digit from [0-9] The expression \D matches any character that is not digit. The expression \s matches any white space character. The expression \S matches any non-white space character. The expression \w will match any word character. Word character includes alphanumeric characters (a-z, A-Z and 0-9) and underscores (_) The expression \W will match any non-word character. Word character includes alphanumeric characters (a-z, A-Z and 0-9) and underscores (_) i.e $ The ^ symbol matches the position at the start of a string. i.e ^123 in  123 4123 The $ symbol matches the position at the end of a string. i.e 123$ in 1234 123 The character class  [ ]  mat