Conversation
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
An actual regular expression is a grammar for a regular language:
brilliant.org/wiki/regular-l
Most implementations (Perl-style, etc.) are cursed and support a lot more via state machine hacks (backreferences, etc.).
re2, Go regexp and Rust regex are actually always regular.
re2, Go regexp and Rust regex also make sure to provide an O(n) time complexity guarantee.
It's also possible to use an index for the approach they use to make it really fast for a search engine:
swtch.com/~rsc/regexp/re
That's how this works:
codesearch.debian.net
4
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
It's about whether you can express it with a FSM (brilliant.org/wiki/finite-st). You have the right idea already.
swtch.com/~rsc/regexp/re is a really good read explaining it.
twitter.com/happyautomata/
Perl's take on it is a total hack with workarounds to make it handle common cases.
Quote Tweet
read image description
ALT
1
3
Show replies


