May 2017
Beginner
552 pages
28h 47m
English
Let's see a few examples of regular expressions:
This regular expression would match any single word:
( +[a-zA-Z]+ +)
The initial + characters say we need 1 or more spaces.
The [a-zA-Z] set is all upper– and lower–case letters. The following plus sign says we need at least one letter and can have more.
The final + characters say we need to terminate the word with one or more spaces.
( +[a-zA-Z]+[?,\.]? +)
The [?,\.]? phrase means we might have a question mark, comma, or a period, but at most one. The period is escaped with a backslash because a bare period is a wildcard that ...