Regular Expressions
Reference: www.regular-expressions.info, Online tool.
cat|dog: Alternates,catordog.\/[^\/]+$Everything after last/on line.^.*svn ci -mVariable prefix ending in "svn ci -m ".^[^{]+\{\{Find first (not last){{on each line."last_updated": ".+[^,]$Find lines with"last_updated": "and not ending in a comma.- Use curly braces to specify repetition. Examples:
[A-Za-z0-9]{32}32-character alphanumeric;[1-9][0-9]{2,4}Number from 100 to 99999. exchange_ratenot followed by a,:exchange_rate(?!,).^((?!affectv).)*$: Match all lines without stringaffectv.<!--[^>]*-->HTML comments.
Special Characters
.Matches any character.(This marks the start of a region for tagging a match.)This marks the end of a tagged region.\nWhere n is 1 through 9 refers to the first through ninth tagged region when searching or replacing. Searching for(Wiki)\1matchesWikiWiki. If the search string wasFred([1-9])XXXand the replace string was *Sam\1YYY, when applied toFred2XXXthis would generateSam2YYY.\0When replacing, the whole matching text.\bThis matches a word boundary.\cA backslash followed on of the following becomes a character class (both inside and outside sets[]).dDecimal digits.DAny char except decimal digits.sWhitespace (space,\t,\n,\r,\fand\v).SAny char except whitespace.wAlphanumeric & underscore.WAny char except alphanumeric & underscore.
\xThis allows you to use a characterxthat would otherwise have a special meaning. For example,\[would be interpreted as[and not as the start of a character set. Use\\for a literal backslash.[...]Matches one of the characters in the set. If the first character in the set is^, it matches the characters NOT in the set. A shorthandS-E(start dash end) is used to specify a set of charactersSup toE, inclusive. The special characters]and-have no special meaning if they appear first in the set.-can also be last in the set. To include both, put]first:[]A-Z-]. Examples:[a-z]Any lowercase alpha;[^]-]Any char except-and];[a-zA-Z]Any alpha.^Matches the start of a line (unless used inside a set, see above).$Matches the end of a line.*Matches 0 or more times. For example,Sa*mmatchesSm,Sam,Saam,Saaamand so on.+Matches 1 or more times. For example,Sa+mmatchesSam,Saam,Saaamand so on.?Matches 0 or 1 time(s). For example,Joh?nmatchesJohnandJon.