Since I have almost no knowledge about regular expressions, I am going to learn it from the very basic. Tom Igoe’s Understanding Network class also requires some regex writings when pulling data from command lines.

I was reading this article as a learning material:

正则表达式30分钟入门教程

Also playing Regex Golf as quizzes

Regex Golf

I realizes it is good to break down(write) the pattern and solve it step be step

Meta-characters

. any character except new line

\\b start or end of a word, word boundary

\\w a letter, number, under-dash, (east asian) character.

\\d a digit, number. = [0-9]

\\s a space, tab, new line divider

^ start of a string (matching search)

$ end of a string (matching search)

if searching a meta-character, add \\ in front of it.

Repeat/loop (counts/amount)

Quantifiers

* 0 or more times