To pique your curiosity, this is what we’ll end up with:
Hence this essay. Before I get started, I would like to put a plug for
,这一点在谷歌浏览器【最新下载地址】中也有详细论述
and this is the crux of why we care: extended operators do not make sense with an ordered OR. if | isn’t commutative, then boolean algebra falls apart. A & B is supposed to equal B & A. ~~A is supposed to equal A. these identities rely on | being true union, not “try left first”. so if you want & and ~ to work correctly, you need commutative semantics. it’s not a style choice, it’s a mathematical necessity. and surprisingly also a reason for our amazing benchmark results - leftmost-longest lets you simplify your regexes without changing the matches, which i will elaborate on in another post, but for now just take my word for it that this is a huge deal for performance.
* @param left 左边界