Your first regex says:
Match a single character present in the list below [1-3]
Match a single character present in the list below [0-2]
Match a single character present in the list below [xs0]
Match a single character present in the list below [30Aa]
Match a single character present in the list below [xsu]
Match a single character present in the list below [.,] exactly six times.
Your second regex says:
^ asserts position at start of the string
Match a single character present in the list below [1-3]
Match a single character present in the list below [0-2]
Match a single character present in the list below [xs0]
Match a single character present in the list below [30Aa]
Match a single character present in the list below [xsu]
Match a single character present in the list below [.,]
$ asserts position at the end of the string,
or before the line terminator right at the end of the string (if any)
So... Your first regex matches strings of length 11, and the second one matches strings of length 6.
[abc]
is a group. It stands for single a or b or c
. You can modify a group by adding:
*
, +
or {}
.
[abc]*
stands for single character a or b or c, match 0 to inf times
. Will match for example:
+
says match at least one time
,
{6}
says match exactly 6 times.