File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ import { RB } from '@gruhn/regex-utils'
3636### Refactor Regex and Check Equivalence 🔄
3737
3838Say we identified a regex in the code base that is prone to
39- [ catastrophic backtracking] ( https://stackoverflow.com/questions/45463148/fixing-catastrophic-backtracking-in-regular-expression ) .
39+ [ catastrophic backtracking] ( https://stackoverflow.com/questions/45463148/fixing-catastrophic-backtracking-in-regular-expression )
4040and came up with a new version:
4141
4242``` typescript
@@ -51,10 +51,12 @@ That is, whether `oldRegex.test(str) === newRegex.test(str)` for every possible
5151RB (oldRegex ).isEquivalent (newRegex ) // true
5252```
5353
54- Checking regex equivalence is also possible with this simple web interface:
54+ There is also a [ web interface] ( https://gruhn.github.io/regex-utils/equiv-checker.html ) for checking regex equivalence
55+ which also shows counterexample strings if the two regular expressions are not equivalent.
56+ The source code is a single HTML file: [ ./equiv-checker.html] ( ./equiv-checker.html ) .
5557
5658<a href =" https://gruhn.github.io/regex-utils/equiv-checker.html " >
57- <img alt =" Screenshot RegExp equivalence checker " src =" ./equiv-checker-screenshot.jpg " />
59+ <img alt =" Screenshot RegExp equivalence checker " src =" ./equiv-checker-screenshot.png " />
5860</a >
5961
6062### Comment Regex using Complement 💬
You can’t perform that action at this time.
0 commit comments