What language/flavor is this? Or I should also ask, if non is specified, what tends to be the default? I'm specifically looking for php or javascript, and I know they're all mostly the same, but not 100%.

David, Regex is programming language neutral, as in, it doesn't matter if you are programming regex expressions in javascript, c#, c++, PHP, or even command line *nix, makes no difference. Only thing you have to watch out for is some programming languages may require different various regex characters to be escaped differently (so the programming language doesn't try to interpret it). Usually a backslash. For instance \\ means ONE backslash in many languages.

@david, this cheat sheet is pretty neutral. The most common flavor is Perl Compatible Regular Expressions (PCRE). Javascript's engine is close to that and PHP also has Perl Compatible functions for Regex; they use the PREG prefix. Most everything on this sheet should be supported by PHP's engine (I think POSIX character classes are not). Javascript's engine isn't as featureful. Some advanced features aren't supported, but all the basics are there. If you need a multiline match and you can't use the flag, you can use an inverted class range such as [\s\S] in place of the . (dot) to match anything including newlines.

@Chilean+kris w, You need to find a resource for learning Regular Expressions. This cheat sheet is for reference, not learning. Check out http://www.regular-expressions.info/

Hey Dave. Thanks for the cheat sheet. You may want to change "Not a or b or c" when you describe the [^abc} negated character class, because in English, the negation is ambiguous. It could mean "neither a nor be nor c." Or the "a" could be the only negated disjunct. You could mean (~a v (b v c)).

Is \x (Regular Expressions Character Classes) supported anywhere? Is this a new class that has just been added, because I am unable to use it in working with IPV6 addresses. Searching for a string containing something like 2001::1a79 with a RegEx 2001::\x{1,4} will fail, but if I use 2001::[a-fA-F0-9]{1,4} will work.

This is a great cheat-sheet. Two minor niggles:
* Would be great to hint on the characters hidden in the character classes (\s = [ \t\n\r\f], \d = [0-9], \w = [a-zA-Z_0-9])
* I think possibly there's a mistake in the section "Special Characters" - \xxx is probably not the octal character xxx. See "Character Classes": it should be \Oxxx (and by the way: why are \O and \x duplicated in "Special Characters" and "Character Classes"...)
And I support Edir's request for a section "Case Conversion".
But again: great sheet, thanks!

I have been searching for programs that others might be using to roll dice in Pachisi on the internet. I know nothing about programming and don't know how to word the question. Are there cheat sheets out there for something like this?

I need to split a group of elment baased on "," delimiter this is the example
input :"(10,{10,9,8,7,6,5,4,3,2,1}),(8,{8,7,6,5,4,3,2,1}),(8,{8,7,6,5,4,3,2,1})
output: (10,{10,9,8,7,6,5,4,3,2,1})
(8,{8,7,6,5,4,3,2,1})
(8,{8,7,6,5,4,3,2,1}) regex: [()], which is not getting me in the way i want.

Do you have any issue with us distributing the PDF regex cheat sheet as is with no changes to others. Before I put it on our internal collaboration tool I need to make sure there are no issues from you in doing so. I will not be modifying the PDF or removing your details from the sheet, it will be just as it is but shareable from within our company's portal.

I'd like to tell it to ignore the Bit On The Side programs but match the rest. I've researched till I'm blue in the face with no luck.

My tiny brain tells me that in regular English it would read like this:
match 'big brother' but not if contains 'bit on the side'
but I'm lost when it comes to translating this to regexp syntax.
I honestly don't know if it accepts Lookahead or Lookbehind which I see is mentioned a lot, sorry.

About Cheatography

10th JuneOn The Blog

5 Ways Cheatography Benefits Your BusinessCheatography Cheat Sheets are a great timesaver for individuals - coders, gardeners, musicians, everybody! But businesses can benefit from them as well - read on to find out more.