Skip to content

Instantly share code, notes, and snippets.

@MikelArnaiz
Created July 20, 2021 16:07
Show Gist options
  • Save MikelArnaiz/ee02df2b2d3957821306413d6115da5d to your computer and use it in GitHub Desktop.
Save MikelArnaiz/ee02df2b2d3957821306413d6115da5d to your computer and use it in GitHub Desktop.
Regex to replace text in VS code in between two words multiline
Search:
export const dispatchToProps = \{((.|\n)+)\};
Replace:
export const dispatchToProps = () => ({$1});
Or:
export const dispatchToProps = \{(.*?)\};
So it would be also:
<h3>(.*?)<\/h3>
### $1
@MikelArnaiz
Copy link
Author

finding connect that with dispatch functions that aren't called dispatchToProps or mapDispatchToProps
connect((.+), (?!(dispatchToProps|mapDispatchToProps))(.+))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment