Skip to content

Instantly share code, notes, and snippets.

@lothrop
Last active October 18, 2019 06:07
Show Gist options
  • Save lothrop/2c7cc2863d0194535123641fdbfd2f5a to your computer and use it in GitHub Desktop.
Save lothrop/2c7cc2863d0194535123641fdbfd2f5a to your computer and use it in GitHub Desktop.
(?<![a-zA-Z0-9_]\s|\*|\*\s)const\s+(?!noexcept|override|final)(unsigned ((long )?long|int|short|char)|[a-zA-Z_:][a-zA-Z0-9_:]*(<([^>]+|(<[^>]+>))>)?)(?![a-zA-Z0-9_();={,]|\s[={])
@lothrop
Copy link
Author

lothrop commented Oct 18, 2019

A regular expression to find all occurrences of const west (e.g., const long) to replace them with east const (e.g., long const) in VSCode. Substitute with $1 const in VSCode.

This will not work in all cases but it is a good start.

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