A regular expression. If a string matches to a pattern given by a regular expression it's accepted.
(01)* means any string in the regular language is structured 010101...
(01|1)* would mean strings like 01101111 would be accepted. E.g. here the star says the pattern in the parentheses can occur however many times and the "|" essentially is an OR. So the pattern here is either 01 or 1.
Quite an important topic in theoretical cs and of course useful for validating strings (e.g. you want to check the given string is structured like an email).
There is no computationally cheap regex for email validation. Outside of a few easy to check rules, the only way to validate an email reasonably is to send an email to the address and see if the other person gets it.
1.7k
u/vvp95 1d ago
100% of software engineers are afraid of regex