Skip to content

Instantly share code, notes, and snippets.

@percyvega
Last active October 6, 2021 01:53
Show Gist options
  • Save percyvega/d22b022d81f8b926f3000bae1625db60 to your computer and use it in GitHub Desktop.
Save percyvega/d22b022d81f8b926f3000bae1625db60 to your computer and use it in GitHub Desktop.
RegEx Cheatsheet

https://regex101.com/

Remove all Javadocs from a file /*(?s:(?!*/).)**/

    \/ matches the character / literally (case sensitive)
    \* matches the character * literally (case sensitive)
    Non-capturing Group. Matches the tokens contained with the following effective flags: s (?s:(?!\*\/).)*
        s modifier: single line. Dot matches newline characters
        * matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
        Negative Lookahead (?!\*\/)
            Assert that the Regex below does not match
            \* matches the character * literally (case sensitive)
            \/ matches the character / literally (case sensitive)
        . matches any character
    \* matches the character * literally (case sensitive)
    \/ matches the character / literally (case sensitive)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment