Finding Code Comments
^(?:[^""]*?(?:""[^""]*?""[^""]*?)?)*(?:/\*|//)
Example:
Finding Lines with an Odd Number of Quotes
^[^"]*"([^"]*|([^"]*"[^"]*"[^"]*)*)$
Reordering Method Parameters
\bMyMethod\s*\(\s*([^,]+|\"[^\"]*\")\s*,\s*([^,]+|\"[^\"]*\")(?=\s*[,)])
MyMethod($2, $1);
Example:
Changing a Method Name
\bMyMethod\s*\(
MyNewMethod(
Example:
Removing Inline Comments
\/\*.*?\*\/
Example:
Matching Variable Names
^[a-z_][a-z0-9_]+$
Example:
Searching for Variable Declarations
^(?:(?:(?!\/\/|\/\*).)*|(?:(?!\/\*).)*\/\*.*?\*\/(?:(?!\/\*).)*)(public|private)?\s+int\s+myvar\s+=
Example:
Searching for Words Within Comments
(/\*|//|')\s*TODO
Example:
Finding GUIDs
[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}|[0-9a-f]{32}
Example:
Setting a SQL Owner
(CREATE\s+PROCEDURE\s+)(?!(?:\w+|\[\w+\])\.)(\w+|\[\w+\])
Example:
Validating Pascal Case Names
^([A-Z][a-z]+)+$
Example:
Changing Null Comparisons
\(\s*(.+)\s*([=!]=)\s*null\s*\)
Example:
Removing Whitespace in Method Calls
(?<=\()\s+|\s+(?=\))
Example:
Parsing Command-Line Arguments
\s+[-/](?<arg>[a-z0-9?]+)([:=](?<val>[^\s""]+|""[^""]*""))?
Example:
Finding Words in Curly Braces
(({{)*{)(?!{)([^}]+)
Example: