Optimize regex for better future. Check index.js
for some sample code as proof of concept
.
((x|y)|z)
to(x|y|z)
((abc))
to(abc)
(x)
tox
(x{5,7})
tox{5,7}
(x){5,7}
tox{5,7}
- Do Not convert
(x{2}){3}
(x{0,n}){m}
tox{0,n*m}
(abc | dbc)
to((a|d)bc)
to[ad]bc
(abc | dbc | koo)
to((a|d)bc | koo)
(abde | abcd | akoo)
toa(bde|bcd|koo)
toa(b(de|cd)|koo)
axc | ayc | azc
toa(x|y|z)c
(aXe | bXf | cXg)
NOT[abc]X[efg]
becausecXe
is not allowed.(abc | abd | abe)
to(a(bc|bd)) | abe
toa(bc|bd|be)
to(a(b(c|d|e)))
to(a(b([cde])))
toab[c-e]
(aab | ab)
toa(ab|b)
toa(a|)b
toa{1,2}b
\w+ \w+ \w+ \w+ \w+ \w+ \d+
to\w+\s\w+\s\w+\s\w+\s\w+\s\w+\s\d+
to(\w+\s){6}\d+
- Add
tests
with examples - Create the solutions
- Publish on npm or somewhere