You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
some of <word>;
<space>;
capture {
1 to 9;
2 of <digit>;
}
should match "Econ 101" capturing "101";
should not match "305";
should not match "Physics 022"
If you have the ability to embed tiny unit tests in your regex declaration, then this could substantially help both to catch regressions and to document the intent behind the regex. The unit tests would be run at compile time, raising something akin to a syntax error if they fail (with clear output as to why they failed, to make it easier to fix).
The text was updated successfully, but these errors were encountered:
Will consider adding this, seems like it could be useful but it introduces regex execution during compilation so I'll need to think how it'll fit. Possibly a flag that would run these rather than output a regex + ignoring them on normal compilation.
Imagine something like this:
If you have the ability to embed tiny unit tests in your regex declaration, then this could substantially help both to catch regressions and to document the intent behind the regex. The unit tests would be run at compile time, raising something akin to a syntax error if they fail (with clear output as to why they failed, to make it easier to fix).
The text was updated successfully, but these errors were encountered: