Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save artisanalcode/84f0a279a77eff3fa360b48ae81c79c3 to your computer and use it in GitHub Desktop.
Save artisanalcode/84f0a279a77eff3fa360b48ae81c79c3 to your computer and use it in GitHub Desktop.
RegEx to find whitespace around separator in the a Java properties file
/**
* Use a lookbehind to make sure we dont accidentaly find ` = ` in the value.
* Prefer the likeliness of missing positive, than getting false positives.
*/
(?<=[a-zA-Z].)+((\s)=(\s)){1}(?=[a-zA-Z])+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment