'hel worldmatches pattern 'hel world'helo worlddoes not match pattern 'hel worldnotice how the last example does not match because there is no character at the period' position in the pattern that' all well and goodbut what if we only want few specific characters to matchwe can put set of characters inside square brackets to match any one of those characters so if we encounter the string [abcin regular expression patternwe know that those five (including the two square bracketscharacters will only match one character in the string being searchedand furtherthat this one character will be either an aa bor see few examples'hello worldmatches pattern 'hel[lp] world'helpo worldmatches pattern 'hel[lp] world'helpo worlddoes not match pattern 'hel[lp] worldthese square bracket sets should be named character setsbut they are more often referred to as character classes oftenwe want to include large range of characters inside these setsand typing them all out can be monotonous and error-prone fortunatelythe regular expression designers thought of this and gave us shortcut the dash characterin character setwill create range this is especially useful if you want to match "all lower case letters""all letters"or "all numbersas follows'hello worlddoes not match pattern 'hello [ -zworld'hello worldmatches pattern 'hello [ -zworld'hello worldmatches pattern 'hello [ -za-zworld'hello worldmatches pattern 'hello [ -za- - worldthere are other ways to match or exclude individual charactersbut you'll need to find more comprehensive tutorial via web search if you want to find out what they areescaping characters if putting period character in pattern matches any arbitrary characterhow do we match just period in stringone way might be to put the period inside square brackets to make character classbut more generic method is to use backslashes to escape it here' regular expression to match two digit decimal numbers between and ' matches pattern ' [ - ][ - ]' does not match pattern ' [ - ][ - ]' , does not match pattern ' [ - ][ - ]