# Defined

Came across RegExp Object prob when tring to learning template engine writing.

# Main()

From the refer link
I recommend that you do not use the RegExp constructor with a literal string, because in literal strings, backslashes must be escaped. The regular expression \w+ can be created as re = /\w+/ or as re = new RegExp("\\w+"). The latter is definitely harder to read. The regular expression \\ matches a single backslash. In JavaScript, this becomes re = /\\/or re = new RegExp("\\\\").

and the demo code is:

PS: I just came across this prob a moment before, but I can remember it today, so Record it.

# Reference

regular-expressions