September 10, 2018
“Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Then they have two problems.”
Although this quote is fantastic, and also though Regular Expressions seem like invented by Egyptians with hieroglyphs, the truth is they are really useful to work with strings.
This is your post if you really don’t know what a regular expression is.
You can use the Class RegExp to create a RE or use the shortcut like in the second example (the common use) between slashes.
The simplest example, to find the pattern in another string we can do the next:
Easy, as you can see you can call the methods directly from /abc/ pattern.
There is a gazillion of shortcuts like that, in reality not too much, to find patterns of numbers, spaces or intros characters, a range of numbers, dates…. etc. Some examples of regular expressions are:
A minimal list as resume is the next:
Do you want to learn more about playing games? You can do it from here: http://regexcrossword.com/
I hope you liked the post and please comment if you like it! Good Programing!