This is just an handy place for me to archive regexes I programmed, that might be useful in the future.
- A single line consisting only of q, not case sensitive ๐
^[Q|q]$
- Single line hash comment, including leading whitespace
(\b|^)\s*#.*$
- Whitespace not between quotes
\s+(?=([^"]*"[^"]*")*[^"]*$)
- Text between quotes, which begin and end a line
(?<=^").+(?="$)
- Public java methods, w/o dockstrigns and annotations
public.*\{[^}]*\}
- Public java methods, w/ docstrings
/[^/]*/(\n)*[^p]*public.*\{[^}]*\}
- Catch blocks containing the throw keyword
catch[^}]*\sthrow\s[^}]*}
- Specific file extensions in a filepath
(?<=^[^\.].*\.)(reg|exp|rss)$
- SHA1 hash preceded by a file path, that is a child of /aParent/Path
(?<=(/aParent/Path/)(.*\s))[0-9a-fA-F]{40}(?=\b)