Skip to content

Instantly share code, notes, and snippets.

@linkarys
Created April 30, 2013 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linkarys/5486253 to your computer and use it in GitHub Desktop.
Save linkarys/5486253 to your computer and use it in GitHub Desktop.
regular expressions: summary
regex{
negated character class:{
[^...]
}
word bundary:{
\b
\<
\>
}
wrod: {
python: (?<!\w)(?=\w)...(?<=\w)(?!\w)
gun: \<...\>
}
modifier:{
i: ignore
g: global
}
number:{
floating-point numbers: ^[-+]?[0-9]+(\.[0-9]+)?$
float: ^[-+]?(\d+|\d+\.\d*|\d*\.\d+)$
}
string:{
any: .*
any without space: (\S*)
content in parenthesis: \([^()]*\)
tag: <[^>+]>
}
hour:{
12: (1[0-2]|[0-9]):[0-5][0-9] *(am|pm)
24: ([01]?[0-9]|2[0-3]):[0-5][0-9]
}
modifier: {
(?i) <--------------> (?-i) not js
}
matchs: {
quote: {
com: "([^"\\]+|\\.)*+"
js: (?:[^\\])"(?:[^"]|(?:[^\\])")*"
}
}
}
07/04/76
07-04-76
07.04.76
9:17 am
18:24
12:30 pm
99:99 pm
bac artf.asdf qwee
"asdfasdf\"aawerasdf"
"/ | - \\" or "[^-^]"
"asdfasdf\"aawerasdf"asdfasdf\"asdfasdf"
"you need a 2\"
""
"very" "long"
56.4
4
0.5
123123.312312
a12312.123a
From
aSubject
Date:s
the the the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment