Closed popey456963 closed 7 years ago
Why?
Because editing one massive regular expression is a lot harder than editing lots of smaller ones. Similar to the reason one doesn't put all of their code on one line but instead spaces it out amongst multiple lines.
^\.|^license|^cname$|^version$|^(patents|authors|contributors|acknowledgments|backers)(\.|$)|^(issue|pull_request)_template\.md$|^(appveyor|circle|codecov)\.yml$|^(yarn|Gemfile)\.lock$|^npm-shrinkwrap\.json$|\.sublime-project$|^(tsconfig|typings|tslint|tsfmt)\.json$|^coffeelint\.json$|^(karma|protractor|sauce).*\.js$|^testem(\.[\w-]+)?\.(json|js)$|^yuidoc\.json$|^stylelint-config\.json
Is not the most appealing regular expression. Whereas in my opinion:
^\.
^license
^cname$
^version$
^(patents|authors|contributors|acknowledgments|backers)(\.|$)
^(issue|pull_request)_template\.md$
^(appveyor|circle|codecov)\.yml$
^(yarn|Gemfile)\.lock$
^npm-shrinkwrap\.json$|\.sublime-project$
^(tsconfig|typings|tslint|tsfmt)\.json$
^coffeelint\.json$
^(karma|protractor|sauce).*\.js$
^testem(\.[\w-]+)?\.(json|js)$
^yuidoc\.json$
^stylelint-config\.json
Is much nicer.
As a point, it would also be simple to implement this. If multiple lines exist just split on them and then join them with pipes to form the single regular expression.
Ah yeah, good point. Pull request welcome :)
Hah I didn't even realize that it had been requested 😁
One note for existing users: the extension will not update your regex, you'll have to do it yourself or leave it empty to get the new multiline defaults.
Would be nice.