SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

optimise the req regex #551

Closed JakeChampion closed 4 years ago

JakeChampion commented 4 years ago

This was optimised by the regexp-tree-cli package like so:

> npx regexp-tree-cli -o -e '/\s*(?:\{(.*)\})?\s*(?:(\$?[^\s]+))?\s*(?:\[([^\]]*)\])?\s*(?:-?\s*([\s\S]*))\s*$/'
 Optimized: /\s*(?:{(.*)})?\s*(?:(\$?\S+))?\s*(?:\[([^\]]*)])?\s*-?\s*([\S\s]*)\s*$/
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 94.752% when pulling 133e490bcf7afde3513242cc70368437b20fc078 on JakeChampion:patch-1 into 8aab5336727dd1d335913ef775d9b7c9028d1e62 on SassDoc:master.

pascalduez commented 4 years ago

Hi @JakeChampion,

interesting. Could you provide a bit more insight on why this would be beneficial, what are you trying to fix or improve etc. ?

JakeChampion commented 4 years ago

The original regex was harder to read due to all the extra escaping of characters which didn't need to be escaped.