Skip to content

Instantly share code, notes, and snippets.

@pavi2410
Last active August 1, 2018 12:39
Show Gist options
  • Select an option

  • Save pavi2410/251bb21e107585d52034f546579fd8dc to your computer and use it in GitHub Desktop.

Select an option

Save pavi2410/251bb21e107585d52034f546579fd8dc to your computer and use it in GitHub Desktop.
Regex to find and format methods for OdeMessages.java. Use https://regexr.com/
// Find
symbol: +method (.+)
// Format
@DefaultMessage("")\n@Description("")\nString $1;\n\n
------------------------------------------------------
// or much powerful (but still needs to set component description manually)
// find
map\.put\(".+-(.+)", MESSAGES\.(.+)\);
// format
@DefaultMessage("$1")\n@Description("")\nString $2;\n\n
@pavi2410

pavi2410 commented Aug 1, 2018

Copy link
Copy Markdown
Author
powershell -Command "& {(Select-String -Path log.txt -Pattern 'map\.put\(".+-(.+)", MESSAGES\.(.+)\);') -replace '.*map\.put\(".+-(.+)", MESSAGES\.(.+)\);', '@DefaultMessage("$1")`n@Description("")`nString $2;' | Out-File odemsg.txt}"

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