Hi there! Thank you for spending your hard-earned money on this book. Use the links below to make sure you get the best out of the book and your valuable time.
Return to Index Page Support Overview Check Errata Email Tech Support Submit Errata Submit Feedback
Regular Expressions
Chapter 5
Page 156 ?US Tel No
\d-\d\d\d-\d\d\d-\d\d\d\d
Page 156?nbsp;US Date
[a-zA-Z][a-zA-Z][a-zA-Z] \d\d \d\d\d\d
Page 157?nbsp;US Date + Dashes
[a-z][a-z][a-z][ -]\d\d[ -]\d\d\d\d
Page 158?nbsp;Credit Card Number
^\d\d\d\d \d\d\d\d \d\d\d\d \d\d\d\d$
Page 159?nbsp;US Tel No Revisited
^\d-\d{3}-\d{3}-\d{4}$
Page 159?nbsp;US Date Revisited
^[a-zA-Z]{3}[ -]\d\d[ -]\d{4}$
Page 160?nbsp;Credit Card Number Revisited
^\d{4} ?\d{4} ?\d{4} ?\d{4}$
Page 161?nbsp;ISBN, Greedy
^(\d[- ]*){9}[\dxX]$
Page 164?nbsp;Lines of text, Greedy
^[\w\W]+$C
Page 165?nbsp;Lines of text, non-greedy
^[\w\W]+?$
Page 166?nbsp;ISBN, non-greedy
^(\d[-\s]*?){9}[\dxX]$
Chapter 6
Page 172?nbsp;HTML element name
<([a-zA-Z]\d?)>[^<]*</\1>
Page 173?nbsp;Capturing Group
([A-Z]{3})\d
Page 173?nbsp;Non-Capturing Group
(?:\d|[A-Z])\w
Page 174?nbsp;Capturing by Name
\b[A-Z][a-z]+ (?<lastName>[A-Z][a-z]+)\b
Page 174?nbsp;Title and Name (Capturing group)
(Mr|Mrs|Miss|Ms|Dr) [A-Z][a-z]*
Page 175?nbsp;Title and Name (Without a group)
Mr|Mrs|Miss|Ms|Dr [A-Z][a-z]*
Page 176?nbsp;Title and Name (Non-capturing group)
(?:Mr|Mrs|Miss|Ms|Dr) [A-Z][a-z]*
Page 176?nbsp;Title, Name, Optional Period
(?:Mr|Mrs|Miss|Ms|Dr)\.? [A-Z][a-z]*
Page 177?nbsp;Collecting Patterns
(\d\d)\s([A-Z][A-Z])
Page 178?nbsp;Named Pattern to Collect
(?<numberGroup>\d\d)\s(?<letterGroup>[A-Z][A-Z])
Page 178?nbsp;Non-Capturing Pattern
(?:\d\d)\s([A-Z][A-Z])
Page 180?nbsp;Capturing Surname, not Title
(?:Mr|Mrs|Miss|Ms|Dr) ([A-Z][a-z]*)
Page 181?nbsp;Explicit Capture
(Mr|Mrs|Miss|Ms|Dr) (?<lastName>[A-Z][a-z]*)
Page 184?nbsp;Named Substitution
(?<firstWord>\b[a-zA-Z]+\b)\s\k<firstWord>
Page 185?nbsp;Positive Look-ahead Assertion
\S+(?=\.NET)
Page 185?nbsp;Negative Look-ahead Assertion
\d{3}(?![A-Z])
Page 185?nbsp;Positive Look-behind Assertion
(?<=New )([A-Z][a-z]+)
Page 186?nbsp;Negative Look-behind Assertion
(?<!1)\d{2}[A-Z]
Page 186?nbsp;Non-backtracking Match
(?>.*)ing
Page 190?nbsp;Non-backtracking on Domain Names
www\.(?>[^.]*)\.com
Page 190?nbsp;Decision Making on Expressions
(?(\d)\dA|[A-Z]B)
Page 191?nbsp;Decision Making on Names
(?(\d)A|B)
Page 192?nbsp;Correct Named Decision Making
(?(\d)\dA|B)
Page 193?nbsp;Case Insensitive Group
(?i:[a-z])
Page 193?nbsp;Case Sensitive Group
(?-i:[a-z])
Page 193?nbsp;Multiple Options in a Group
(?n-i:[a-z])
Chapter 7
Page 202?nbsp;Floating Point Numbers
^(?:\+|-)?\d+(?:\.\d+)?$
Page 203?nbsp;Telephone Numbers
^(\+\d{1,3} ?)?(\(\d{1,5}\)|\d{1,5}) ?\d{3} ?\d{0,7}( (x|xtn|ext|extn|extension)?" \.? ?\d{1,5})?$
Page 206?nbsp;Postal Codes
^(\d{5}(-\d{4})?|"([a-z][a-z]\d\d?|[a-z]{2}\d[a-z]) ?\d[a-z][a-z])$
Page 208?nbsp;IP Addresses
^((1??\d{1,2}|2[0-4]\d|25[0-5])\.){3}(1??\d{1,2}|2[0-4]\d|25[0-5])$
Page 209?nbsp;Domain Name
^(([a-z]|#\d+?)([a-z0-9-]|#\d+?)*([a-z0-9]|#\d+?)\.)+([a-z]{2,4})$
Page 210?nbsp;Email Name
^(([^<>()\[\]\\.,;:@"\x00-\x20\x7F]|\\.)+|("""([^\x0A\x0D"\\]|\\\\)+"""))$
Page 210?nbsp;Email Address
^(?<person>([^<>()\[\]\\.,;:@"\x00-\x20\x7F]|\\.)+|("""([^\x0A\x0D"\\]|\\\\)+"""))@(?<domain>(([a-z]|#\d+?)([a-z0-9-]|#\d+?)*([a-z0-9]|#\d+?)\.)+([a-z]{2,4})|((1??\d{1,2}|2[0-4]\d|25[0-5])\.){3}(1??\d{1,2}|2[0-4]\d|25[0-5]))$
Page 222?nbsp;Matching HTML Tags
(<[a-z]+[^>]*>)|(</[a-z\d]+>)
Page 224?nbsp;Extracting HTML Tags
<(?<outertag>[a-z]+[\d]?)(?<attributes> [^>]*)*>(?<innerhtml>(<(?<innertag>[a-z]+[\d]?)[^>]*>.*?</\k<innertag>>|<[a-z]+[\d]?[^>]*>|(?>[^<]*))*(?=</\k<outertag>>))?