facebookarchive / codemod

Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.
Apache License 2.0
4.11k stars 198 forks source link

How to test regex #101

Open kirkstrobeck opened 6 years ago

kirkstrobeck commented 6 years ago

I’m using https://pythex.org with this search = \((.*)\) => { and this string Date.now = () => 1; and it does not match. However, when using that in codemod it is matched. How can I tell codemod to respect the { character.

codemod -m -d lib --extensions js \
    ' = \((.*)\) => {' \
    '(\1) {'