Open gricha2380 opened 6 years ago
AKA: learning the concept & reasons
/ ... /
/ ... /igm
AKA: learning the commands
/literal/
matches "literal"
.
/.*/
|
/everything|something/
/^pattern/
/pattern$/
/^literal/
will match "literal lesson"
/^literal/
will not match "Something literal"
/^[literal]/
will match anything except "literal"
/literal$/
will match "Something literal"
\
e.g.: \.
/./
matches all characters including whitespaces.
to match lteral period+
matches one or more of preceeding patternl{1,3}
matches one to three repeated instances of letter l?
is used to make a pattern optional
/pie?/
matches pi
\d
vs [0-9]
\w
vs [a-zA-Z]
\D
vs ^[a-zA-Z]
/Greg(ory)?/i
matches greg
and gregory
\1
Used to repeat the previous pattern(?<mygroup>[abc])=\k<mygroup>
same as ([abc])=\1
AKA: Applying the knowledge
hello
except the last
hello helllllllo helllo helo
/hel{2,6}o/
abc123xyz
/\d/
or /[1-3]/
bird. mouse. house
/.*\./
^(http|https):\/\/+[\www\d]+\.[\w]+(\/[\w\d]+)?
AKA: What regex can do for you
neighbo?ur
apologize || apologise
Jan(uary)?
{3}(.)?
/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}/
/^.+@.+$/
/((\<1[\-\. ])?(\(|\<)\d\d\d[\)\.\-/ ] ?)?\<\d\d\d[\.\- ]\d\d\d\d\>/
/\<\d\d\d[\- ]\d\d[\- ]\d\d\d\d\>/
<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>
<title>(.*)</title>
^[ \t]+|[ \t]+$
[ \t\r\n]
^(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$
/\<((\d\d\d\d)[\- ]){3}\d\d\d\d\>/
^[+-]?[0-9]{1,3}(?:,?[0-9]{3})*\.[0-9]{2}$
Now that the engine is solid, there needs to be an actual game. The core purpose of this is to teach regex. A thoughtful plan needs to be produced to outline the knowledge journey that can be addressed using the tools I've created.
General approach
To kickstart the process, here is a list of game engine features to utilize. These can be kept in mind as the syllabus is being created, because each element of the syllabus will be showcased using the mechanisms below:
How to use tools: