Skip to content

Instantly share code, notes, and snippets.

@bcorreia
bcorreia / gist:99d9768de93f574c0064
Last active February 18, 2021 08:49
Regex Cheat Sheet

Regex

Cheat Sheet

Sample Patterns

# Phone e.g. (619) 123-9977
/\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}/

# Email address
/^([\w\.-]+)@([\w-]+)(\.[a-z]{2,})|(\.[a-z]{2})$/igm
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjIwMDAwMDAxNzkgMC4yMzkyMTU3MDE4IDAuMjc0NTA5ODE3NAAQAoAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp