There is a newer version of this cheat sheet!
The Regular Expressions cheat sheet is designed to be printed on an A4 sheet of paper and live by a designer or developer's desk, to make life a bit easier. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size Regular Expressions cheat sheet.
I have included a little more detail in this document where I felt it would be helpful to those less familiar with regular expressions, to demonstrate some of the items on the sheet. Please feel free to let me know if any additions would be helpful.
Please also note that not everything on this sheet will work with every language that has regular expression support. Different languages use regular expressions in different ways, and in some, support is incomplete.
Anchors
Anchors in regular expressions refer to the start and end of things. This can be, for example, a string or word. These characters and symbols represent these anchors in regular expressions. For example, a pattern that matched a string that started with numbers might be the following, where "^" represents the start of the string.
^[0-9]+
Without the "^" symbol, the pattern would match any string with a digit in it.
Character Classes
Character Classes in regular expressions match a selection of characters at once. For example, "\d" will match any digit from 0 to 9 inclusive. "\w" will match letters and digits, and "\W" will match everything but letters and digits. A pattern to indentify letters, numbers or whitespace could be:
\w\s
POSIX
POSIX is a relatively new addition to the regular expressions family, and is quite similar to the idea behind character classes, allowing you to use a shortcut to represent a particular group of characters.
Assertions
Almost everyone has some trouble with assertions at first. They are tricky to get to grips with, but once you are familiar with them, you will use them alarmingly often. They provide a way to say "I want to find out every word in this document with a q in it, as long as that q isn't followed by 'werty'".
[^\s]*q(?!werty)[^\s]*
The above code starts by matching non-whitespace characters ([^\s]*), then a q (err ... q). Then the parser reaches the lookahead assertion. This makes the q conditional. The q will only be matched if the assertion is true. In this case, the assertion is a negative assertion. It will be true if what it checks for is not found.
So, it checks the next few characters against the pattern it has (werty). If they are found, the assertion is false, and so it will "ignore" the q - it will not match. If it doesn't find "werty", the assertion is true, and the q is matched. It then carries on checking for non-whitespace characters.
Quantifiers and Quantifier Modifiers
Quantifiers allow you to specify a part of a pattern that must be matched a certain number of times. For example, if you wanted to find out if a document contained between 10 and 20 (inclusive) of the letter "a" in a row, you could use this pattern:
a{10,20}
Quantifier are "greedy" by default. So the quantifier "+", which means "one or more", will match as many items as possible. This can be a problem on occasion, so you can tell a quantifier to not be greedy (to be "lazy"), using a modifier. Consider the following code:
".*"
This will match text contained in quotation marks. However, you may have a string like this:
<a href="helloworld.htm" title="Hello World">Hello World</a>
The pattern above will match the following from the above string:
"helloworld.htm" title="Hello World"
It has been too greedy, matching as much text as it could.
".*?"
The above pattern will also match any characters contained in quotation marks. The non-greegy version (note the "?" modifier) will match as little as possible of the string, so will match each item in quotation marks separately:
"helloworld.htm""Hello World"
Escape Character and Metacharacters
Regular expressions use symbols to represent certain things. However, that presents a problem if you want to detect a character in a string where that character is a symbol. A period (".") for example, in a regular expression, represents "any character except the new line character". If you want to find a period in a string, you can't just use "." as a pattern - it will match just about everything. So, you need to tell the parser to treat the period as a literal period rather than a special character. This you do with an escape character.
An escape character precedes the special character and tells the parser to ignore what follows. There are certain characters that will need to be escaped in the majority of patterns and languages, and these are also listed here.
The pattern to match a period is:
\.
Special Characters
Special characters in regular expressions represent unusual elements in text. New lines and tabs, for example, can be typed using a keyboard, but are likely to trip up programming languages. The special characters use the escape character as well, to tell the regular expression parser that the following character is to be treated as a special character rather than a normal letter or number.
Groups and Ranges
Groups and ranges are very very useful. Ranges are perhaps the easiest place to begin. They allow you to specify a selection of characters to match. For example, if you wanted to see if a string contained hexadecimal characters (zero to nine and a to f), you would use this range:
[A-Fa-f0-9]
If you wanted to see if a string did not contain the same, you would use a negative range, which in this case will match any character that isn't zero to nine or a to f.
[^A-Fa-f0-9]
Groups are essential to regular expressions, and are most often used when you want to use "or" in a pattern, or you want to reference part of a pattern later in the same pattern, or where using regular expression string replacement.
To use "or" is very simple - the following will match "ab" or "bc":
(ab|bc)
If you want to reference a previous group in a regular expression, you would use "\n", where "n" is the number of the group. You might need a pattern to match "aaa" or "bbb", followed by numbers, followed by the same 3 letters, and this would be done with groups, like so:
(aaa|bbb)[0-9]+\1
The above matches "aaa or bbb", and groups the match with the brackets. This is followed by a pattern for one or more numbers ("[0-9]+"), then finally "\1". The "\1" backreferences the first group, and looks for the same thing. It will match the matched text from the string, not the pattern, so "aaa123bbb" will not match the above pattern, as the "\1" will be looking for "aaa" to follow the numbers.
String replacement is one of the most useful tools of regular expressions. You can use "$n" to reference groups matched with the pattern when replacing text. Let's say you are want to make every instance of the word "wish" bold in a block of text. You would use a regular expression replacement function for this, which might look a little like this:
replace(pattern, replacement, subject)
The pattern is first, and would be something like the following (you would need a few extra characters for this specific function.
([^A-Za-z0-9])(wish)([^A-Za-z0-9])
This will find any instance of the word wish where it is preceded and followed by any non-alphanumeric character.
Your replacement can then be:
$1<b>$2</b>$3
This replacement will replace the whole pattern matched above. We start with the first character matched above ($1) (the first non-alphanumeric one), otherwise we'll be deleting characters from the block of text. The same applies at the end ($3) of the match. In the middle, we add the HTML tags for bold text (though you should use CSS or <strong>, of course), with the second group matched in the pattern ($2).
Pattern Modifiers
Pattern modifiers are used in several languages, most notably Perl. These allow you to change how the parser works. For example, the "i" modifier will tell the parser to ignore case.
In Perl, regular expressions contain the same character at the beginning and end. This can be any character at all (often "/"), and is used like so:
/pattern/
Modifiers would be added at the end of this, like so:
/pattern/i
String Replacement
String replacement has already been covered above, however one small addition to note is the existence of "passive" groups. These are groups that are ignored for the purposes of replacement. This is very useful when you want to match something that requires an "or" section, but don't want it in the replacement.
Sample Patterns
Finally, there is a selection of sample patterns. These patterns are intended to allow you to look at how regular expressions might be used in day-to-day work, and the various ways you can use regular expressions. Please note, however, that they will not necessarily work in every language, as each has its own idiosyncracies and varying support for regular expressions.
Download
So now that you know what it does, please feel free to print out the Regular Expressions cheat sheet:
And finally, if you like the cheat sheets, and want to say thanks, please consider buying me something from my Amazon Wishlist. Thankyou very much to those who have already hunted it down and sent me something nice - I'm very grateful!
Please note: If you wish to link to the Regular Expressions cheat sheet from elsewhere, please link to this page so others find the description, rather than linking directly to the sheet.

162 Comments
Thank you very much!
I am one of those folks who has trouble reading regular expressions and creating my own.
This is gonna be a big help, it's currently hanging next to my monitor. :)
#1, Harmen Janssen, Netherlands, 14 September 2006. Reply to this.
Thank you!! These cheat sheets are so very useful, I have them all (?apart from the WoW one) printed out and stuck on my wall :P.
I would love a C# one, do you plan on making some for anymore languages?
#2, James Selby, United Kingdom, 15 September 2006. Reply to this.
Thanks a whole lot!
This was the cheat sheet I always waited for.
Regular Expressions are indeed powerfull, but often, also quite uncontrollable.
Hope this sheet helps.
#3, Jörn, Germany, 15 September 2006. Reply to this.
Hi Harmen, James and Jörn,
Glad you like the cheat sheet - it's one I've been working on for a long time, and I've used a few different versions myself over the last few months. This is the one I've personally found most useful.
James: I plan to make a few more, yes. I'm quite enjoying putting them together, and as long as people find them helpful, I'll keep doing them. One problem is that I'm running out of languages I actually know. I'm learning Python at the moment, and am creating a cheat sheet for that as I go.
I don't know C#, so to create a cheat sheet for that I would need some help with the content. Anyone who wants to help, feel free to email me.
#4, Dave Child, United Kingdom, 15 September 2006. Reply to this.
Awesome!
#5, Slave-4-Code, Lithuania, 15 September 2006. Reply to this.
Love your cheat sheets! This regular expression sheet is killer. There are a few items that you could add in the future:
Assertions
?<= Lookbehind
?!= or ?<! Negative Lookbehind
?> Once-only Subexpression
?() Condition [if then]
?()| Condition [if then else]
?# Comment
Case Conversion:
\E Terminate \L or \U conversion
\l Convert next character to lowercase
\L Convert all characters up to \E to lowercase
\u Convert next character to uppercase
\U Convert all characters up to \E to uppercase
\Q Disable pattern metacharacters up to \E
Special Characters:
\a Alarm
[\b] Backspace
\e Escape
\N{name} Named character
#6, Chris, United States, 15 September 2006. Reply to this.
I have all your cheat sheets taped to my wardrobe at them moment sort of for revision... Brilliant work keep it up.
Thanks
#7, Jonathan Schultz, United Kingdom, 16 September 2006. Reply to this.
Chris:
I've added the assertions from your list and uploaded the revised version. Thankyou! I can't fit the rest on easily though. I'll have another go and see if I can add those bits in as well, because they would be useful.
Jonathan, Slave:
Thanks - glad you like it :)
#8, Dave Child, Unknown, 16 September 2006. Reply to this.
In case you missed it,
(?: is handy for matching a subpattern without capturing it.
#9, Halfdeck, United States, 17 September 2006. Reply to this.
Wonderful! Thank you very much... if only I had a printer! ;)
I can see this popping up on my other monitor (dual setup) - Great resource.
#10, Carl, United Kingdom, 21 September 2006. Reply to this.
seed torrent please..
#11, uncle spam, Unknown, 22 September 2006. Reply to this.
Really great resource, especially for people like me that have a bad memory, something like this is pure gold.
Thanks for taking the time to make it and share it :)
#12, Thor, United Kingdom, 22 September 2006. Reply to this.
Cheers Dave, Awesome cheat sheet!
#13, Ryan, United Kingdom, 26 September 2006. Reply to this.
Thank you!! These cheat sheets are very useful!
#14, Gabriev, France, 2 October 2006. Reply to this.
Thanks.it's very useful. :D
#15, arejae, Malaysia, 5 October 2006. Reply to this.
Lovely! Thank you.
#16, Chuck Bergeron, Canada, 7 October 2006. Reply to this.
Thanks for sharing it, It will help me and my mind ;)
Paul
#17, Referencement - SEO, France, 8 October 2006. Reply to this.
Looks nice, but the black-on-red sections disagree badly with both my printer options. Any chance of a monochrome-clean version?
#18, Theuns, New Zealand, 9 October 2006. Reply to this.
Hi Theuns,
Sorry to hear about the black on red giving you trouble. When you say "monochrome-clean", I'm assuming you don't mean a greyscale version of the same thing - but could you let me know more specifically what you want, and I'll see if I can oblige.
#19, Dave Child, United Kingdom, 9 October 2006. Reply to this.
Thank you
I think that example email regexp do not work on the mail like
first.last@abce.com
#20, Max, Switzerland, 9 October 2006. Reply to this.
Hi Max,
The email validator regex is not a production one - those examples are intended to help people to write their own (to have full production regexes that cover every eventuality, rather than ones that demonstrate the principle, would have meant using up most of the available space, making the examples unreadable, or including so few examples that they would be useless).
For a more complete RegEx email validator, check out http://www.addedbytes.com/php/email-address-validation/
#21, Dave Child, United Kingdom, 10 October 2006. Reply to this.
Thanks Dave! It's wonderful!
Could you clarify one niggling detail for me? Will [:alpha:] capture any unicode alpha character, or simply ascii alpha?
#22, Amgine, Canada, 18 October 2006. Reply to this.
This is the only organized, very well at that, regex explanation I have ever seen. I feel like I can actually start using them more often now because now I know what the heck I'm lookign at! Thanks dude!
#23, Scott, United States, 18 October 2006. Reply to this.
If hosting the PDF file is an issue because of bandwidth, you could create a temp blog at wordpress.com and upload it there.
#24, engtech, Canada, 18 October 2006. Reply to this.
This is awesome. I was waiting for a thing like that from ages. Great work.
#25, Dhaya B., France, 30 October 2006. Reply to this.
Thank you so much for the regex cheat sheet. I would also like to thank you for your php, mysql, and css cheat sheets aswell.
How did you get the idea of making cheat sheets in the first place???? A very ingenious idea.
#26, clinton bowen, Unknown, 1 November 2006. Reply to this.
Hi Clinton,
You're very welcome - glad you like them. The first cheat sheet I put together was because I had lots of notes and print-outs from various PHP and CSS sites on my desk. I decided to consolidate the information I regularly needed into one sheet. I found it really useful and thought other people might as well, so released it.
#27, Dave Child, United Kingdom, 2 November 2006. Reply to this.
great cheat sheep. Thanks Mate
#28, vans, Australia, 3 November 2006. Reply to this.
Thanks so much for a great tool! It's really going to help out!
#29, McWilliams, United States, 10 November 2006. Reply to this.
Very nice cheat sheet! Thanks alot!
#30, henry, Switzerland, 11 November 2006. Reply to this.
Hey Dave,
Just want to say a HUGE thank you for all your efforts on the cheat-sheets!! Really helpful and just plain AWESOME! :-)
Cheers
#31, Bjorn, Unknown, 19 December 2006. Reply to this.
This is a great collection. Top marks for sharing.
Thanks Again
Brian
#32, Brian, New Zealand, 25 December 2006. Reply to this.
your summary of regular expression image was useful, i had save it in my computre for future reference.
#33, william, Malaysia, 20 January 2007. Reply to this.
very useful ,ill use it on the office
taped to the desktop!
#34, Fangelico, Argentina, 24 January 2007. Reply to this.
Thanks Mate, very useful for me too !
#35, bidibul, France, 11 February 2007. Reply to this.
Thanks again.
I love this sheet.
adkdev
#36, adkdev, Thailand, 23 February 2007. Reply to this.
This sheet is very helpful for me.
Thanks a lot.
#37, Kumara Swamy, India, 7 March 2007. Reply to this.
Thank you, this cheat sheet is really handy. :-)
#38, Blackened, Unknown, 18 March 2007. Reply to this.
Thanks for this great cheat sheet! I've found that css regex does not work in IE6. I don't know about 7 yet, but I'll check it once I get home. All I'm doing is placing an icon next to a url if it matches a certain filetype:
a[href $='.xls']{
background: url(../../images/icons/excel.gif) no-repeat;
padding: 0 0 5px 17pt;
}
It works in FF, but not ie6. Great sheet though, as well as the rest of your site! Thanks!
#39, John, United States, 26 March 2007. Reply to this.
Cool, yet another really useful cheatsheet!
Also, check out this awesome regex screencast http://digg.com/programming/Learning_Regular_Expressions_Video_Tutorial_and_Cheatsheet
Keep up the good work ;-)
#40, Peter Hansen, Finland, 10 April 2007. Reply to this.
For a learner like myself, this cheat sheet is wondeful. Now if they'll just let me take it into exams I might pass. You're a blessing.
#41, Libby, Australia, 12 April 2007. Reply to this.
Que bueno que di con este pdf!!! me fue de muchísima ayuda!!! muchas gracias!!!
#42, Euge, Chile, 12 April 2007. Reply to this.
Thx very much! These cheat sheets do save our time and brain..
#43, darkpilgrim, China, 27 April 2007. Reply to this.
YOU rock..
That was so useful. I was working on something related to this site www.adiazar.com URL router (still not up).
Thanks
#44, Adi Azar, Unknown, 2 June 2007. Reply to this.
Will capture any unicode alpha character, or simply ascii alpha?
#45, rezon, Unknown, 10 June 2007. Reply to this.
Nice regex cheat sheet!
Here is a little token of appreciation on my part.
This is for everyone who is being penalized by SE for canonical duplication of dir name and index.html
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forum/\ HTTP/
RewriteRule ^forum/$ http://www.travelinasia.net/forum/index.php [R=301,nc]
In this example I am rewriting forum/ to forum/index.php
If you do not use the above method you will go into an infinite loop!
If you want to rewite index.php to directory do this.
You can replace RewiteCondition forum/ with forum/index.php
And RewriteRule to forum/index.php
http://www.domain.com/forum/
Enjoy.
#46, Igor Berger, Japan, 12 July 2007. Reply to this.
Hey Dave, You are the best!!
#47, Mad Max, United States, 3 August 2007. Reply to this.
Corrections:
^ start of line
$ end of line (before \n)
#48, Brianary, United States, 6 August 2007. Reply to this.
hey, what is the regex dialect you're cheatsheeting?
i've thought it's a perl one, but /U ? but \x?
then i've thought it's a pcre one, but then $& and $+ are not from there..
#49, codesnik, Unknown, 11 August 2007. Reply to this.
Hi codesnik: As it says in the article:
"Please also note that not everything on this sheet will work with every language that has regular expression support. Different languages use regular expressions in different ways, and in some, support is incomplete."
It's a combination of regex support in a few languages, primarily PHP and PCRE. This is the problem with doing a regular expression cheat sheet - you either tie it to one language or technology, or keep it entirely generic and add too much.
#50, Dave Child, United Kingdom, 11 August 2007. Reply to this.
Thanks for very interesting article. btw. I really enjoyed reading all of your posts. It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more. So please keep up the great work. Greetings.
#51, Onlineshop Artikelverzeichnis, Germany, 27 August 2007. Reply to this.
This is a great resource! I really think that every developer needs to put regex skills in their coding arsenal.
It would be great if you put out language/implementation specific cheat sheets as some of the other comments have suggested. There are some great "cheat-sheet-able" syntax that is language/implementation specific.
Thanks again! I linked to this post in my most recent post.
#52, Ian, Unknown, 28 August 2007. Reply to this.
Thanks for this really useful article.Great cheat sheet, I appreciate it very much.
#53, Versand, Germany, 28 August 2007. Reply to this.
Thanks for this really useful article.Great cheat sheet, I appreciate it very much.
#54, Versand, Germany, 28 August 2007. Reply to this.
Great Job Dave,
#55, windows_mss, India, 9 September 2007. Reply to this.
Cheat sheet is the shit!
Thanks Dave ^^
#56, oxar, Italy, 13 September 2007. Reply to this.
This is a great collection. Top marks for sharing.
Thanks.
#57, Alonzo Mourning, Unknown, 22 September 2007. Reply to this.
Fabulous work. Thank you for your effort and sharing.
Regards
#58, Pozycjonowanie, Poland, 23 September 2007. Reply to this.
This is a great collection. Top marks for sharing.
Thanks.
#59, Federico, Turkey, 24 September 2007. Reply to this.
Great Job Dave,
#60, Julia, Turkey, 24 September 2007. Reply to this.
Thank you very much for your wonderful work.
#61, Wellness SPA, Germany, 26 September 2007. Reply to this.
all of your cheat sheets are amazing. very helpful!
thank you.
#62, paul, Unknown, 2 October 2007. Reply to this.
It is very intresting dont't you think so?
#63, Bilety lotnicze, Unknown, 7 October 2007. Reply to this.
I've become an addict of cheatsheets, and it's all your fault!
Thanks
#64, vole, United States, 15 October 2007. Reply to this.
Thanks for very interesting article. btw. I really enjoyed reading all of your posts. It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more. So please keep up the great work. Greetings.
#65, Hundehalsband, Germany, 16 October 2007. Reply to this.
One problem is that I'm running out of languages I actually know. Thank you, this cheat sheet is really handy.
#66, Alex, Ukraine, 18 October 2007. Reply to this.
If you do not use the above method you will go into an infinite loop!
#67, Iren, Ukraine, 19 October 2007. Reply to this.
I found it very useful for my new yellow pages site since i need to do a lot of regex to figure out where should do the routing.
Thanks man! A lot of useful content
#68, dakota, United States, 22 October 2007. Reply to this.
Thanks, i printed every sheet and use it very often, it´s more comfortable than searching it again and again.
#69, Marc, Unknown, 27 October 2007. Reply to this.
I found it very useful for my new yellow pages site since i need to do a lot of regex to figure out where should do the routing.
Thanks man! A lot of useful content
#70, Lena, Unknown, 27 October 2007. Reply to this.
Thanks, i printed every sheet and use it very often, it´s more comfortable than searching it again and again.
#71, Lena, Unknown, 27 October 2007. Reply to this.
Cheat sheet is the shit!
Thanks Dave ^^
#72, Lena, Unknown, 27 October 2007. Reply to this.
Thanks for very interesting article. btw. I really enjoyed reading all of your posts. It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more. So please keep up the great work. Greetings.
#73, Lena, Unknown, 27 October 2007. Reply to this.
Thank you very much for your wonderful work.
#74, Lena, Unknown, 27 October 2007. Reply to this.
I've become an addict of cheatsheets, and it's all your fault!
Thanks
#75, Lena, Unknown, 27 October 2007. Reply to this.
Fabulous work. Thank you for your effort and sharing.
Regards
#76, Lena, Unknown, 27 October 2007. Reply to this.
Thanks, i printed every sheet and use it very often, it´s more comfortable than searching it again and again.
#77, Lena, Unknown, 30 October 2007. Reply to this.
Great sheets.
Few people asked about using it in C#. It doesn't take many changes. If you have visual studio you can look at a couple of expressions made in the VS Validation code to get an idea of the minor differences.
Most of the problems I've had have been in the idea of using one / instead of // and things like that.
#78, ADAC, United States, 6 November 2007. Reply to this.
Great work, thanks for your effort!
Unless I'm totally blind, it seems there's no printable version of this page... this would be nice as your intros for each section are useful too...
#79, Sorin, Unknown, 9 November 2007. Reply to this.
Thank you for this useful sheets!!!
#80, Hanfpflanzen, Germany, 12 November 2007. Reply to this.
I just want to give you my gratitude for putting together an excellent document. The perfect reference guide! Thanks.
#81, Gary F, Unknown, 16 November 2007. Reply to this.
Thanks a whole bunch!
This was the cheat sheet I always dreamt about.
regex's are indeed powerful, but often, also quite illegible.
Hope this sheet helps everybody.
#82, Madhuri Dixit, Japan, 10 December 2007. Reply to this.
Thank you very much!
I'll laminate it and put it on my desk
Wolfgang
#83, wolfgang, Germany, 15 December 2007. Reply to this.
This sheet is really helpful. I've pasted it at my desk. ;)
Thank you!
#84, aakash, India, 18 December 2007. Reply to this.
really very usefull......... thanks and keep it up..
#85, Sanjay Kachhwaha, India, 21 December 2007. Reply to this.
We gotta love him!!
#86, Mad Max, Unknown, 21 December 2007. Reply to this.
This is awesome. Thank you so much!
#87, Alex Mailer, Republic Of Moldova, 27 December 2007. Reply to this.
it seems there's no printable version of this page... this would be nice as your intros for each section are useful too..
#88, Enya, Unknown, 27 December 2007. Reply to this.
I love Jack Daniels almost as much as Regular Expressions... At least... after having read this tutorial ;-) . Now at least I know what I'm drinking... ooops... working with I mean!
Only thing that wuries me a bit is the difference in RE's in javascript, vbscript, PHP, ASP, ....
But still... great stuff Dave!!! Thanx
#89, Jano?ik, Slovakia, 28 December 2007. Reply to this.
PS: for all those who can't PRINT this... Why not just "save image as..." (the .png) and print that???
#90, Jano?ik, Slovakia, 28 December 2007. Reply to this.
OMG, not only special characters list, but this one... you made my day. Thanks again!
#91, Logo designer, Russian Federation, 31 December 2007. Reply to this.
man, i just love those cheat sheets.
#92, Onlinespiele, Germany, 5 January 2008. Reply to this.
Interesting post, Ill be checking back to refer to these cheat sheets
#93, MT, Canada, 5 January 2008. Reply to this.
Sweet Cheat Sheets Ive saved them all.
#94, Jeff, Canada, 5 January 2008. Reply to this.
Nice starter's manual. Thanks!
#95, Sam, United Kingdom, 6 January 2008. Reply to this.
Dude If you have visual studio you can look at a couple of expressions made in the VS Validation code to get an idea of the minor differences...
#96, Galatasaray, Unknown, 9 January 2008. Reply to this.
It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more.
#97, Rich, Ukraine, 14 January 2008. Reply to this.
I just want to say thank you for all the cheatsheets you have done. They are really really helpful, great time saver.
Regards
#98, yellow1912, United States, 18 January 2008. Reply to this.
Thanks for the great cheatsheets. It was a big help.
#99, Ryan Yockey, United States, 21 January 2008. Reply to this.
Here's a good JavaScript regex tester: http://regexpal.com
#100, Steve, Unknown, 22 January 2008. Reply to this.
Nice constribution. Thank you and greets from germany!
#101, Tanzschule Coburg, Germany, 25 January 2008. Reply to this.
This is what I needed. I've always been intimidated by regular expressions.
#102, Regexp Timid, United States, 9 February 2008. Reply to this.
Thankya! I just started teaching myself and every little bit of reference material helps.
#103, Defektiv, United States, 9 February 2008. Reply to this.
A very useful cheat sheet
#104, Posicionamiento web Valencia, Unknown, 13 February 2008. Reply to this.
Great article. Greetings!
#105, Produktdesign, Germany, 14 February 2008. Reply to this.
This is awesome. Thank you so much!
hi from spain :)
#106, Posicionamiento web Valencia, Spain, 18 February 2008. Reply to this.
another must have cheat sheet, regex has become one of fundamental elements in web programming world.
#107, baliwebdesigner, Australia, 18 February 2008. Reply to this.
Thanks you. I love Regular Expressions too.
#108, HTMLeando, Cuba, 18 February 2008. Reply to this.
Thanks for sharing it, It will help me and my mind ;)
#109, Richard, Ukraine, 20 February 2008. Reply to this.
Thanks a whole lot!
This was the cheat sheet I always waited for.
Regular Expressions are indeed powerfull, but often, also quite uncontrollable.
Hope this sheet helps.
#110, David, Ukraine, 20 February 2008. Reply to this.
This is a great resource! I really think that every developer needs to put regex skills in their coding arsenal.
It would be great if you put out language/implementation specific cheat sheets as some of the other comments have suggested. There are some great "cheat-sheet-able" syntax that is language/implementation specific.
Thanks again! I linked to this post in my most recent post.
#111, Iren, Ukraine, 20 February 2008. Reply to this.
Thanks for this really useful article.Great cheat sheet, I appreciate it very much.
#112, Anna, Ukraine, 20 February 2008. Reply to this.
I am looking for some PERL expression that will be
able to identify the following strings as part of a
file name and/or directory name -
ie under windows, files could be named as
myfile01 070605.txt
myfile0120080103.tst
myfile01 2007_8_23.dif
myfile01January 3, 2008.doc
My task is to find the root ('myfile01') of these files where
the root could be any string (numeric / character combined)
AND
then pull off the last portion of the file name and/or
directory name and determine if that is some form of a date
such as:
a.Yymmdd "070605"
b.yyyymmdd "20080103"
c.2007_8_23
d.Text dates: "January 3, 2008"
This appears to be a good example of using PERL, or maybe
brute force to determine what the root is character by
character and checking against the entire set of records
to see if the root is consistent across all entries.
It will be assumed that the root will always be the first
part of the file name, and the date portion will be the last
part of the file name.
I will also need to determine if the date portion is in fact
some kind of date naming convention such as listed above
and probably more variations as well.
Any help would be appreciated - I am going to start on
this over the weekend.
Regards,
Charles Patridge
Email: Charles_S_Patridge {at} prodigy [dot] net
#113, Charles Patridge, Unknown, 29 February 2008. Reply to this.
there are some good tools that generate them automatically, but this is for print! Thanks!
#114, Jordi Oller, Spain, 1 March 2008. Reply to this.
Thanks for this, helped a lot in customising my php design.
#115, Dr Y Teoh, United Kingdom, 16 March 2008. Reply to this.
Thanks for this. Great cheat sheet.
#116, GasheK, Russian Federation, 22 March 2008. Reply to this.
Thanks for the cheat sheet... very useful
#117, devang gandhi, Unknown, 24 March 2008. Reply to this.
Great cheat sheet. Will use it to its full potential (up on my note board by the side of my desk). I'm going to need to understand Regular Expressions fully for a project I want to start working on for one of my own websites. Need to get it programmed before i work on the design.
#118, Adaptiv Web Design, United Kingdom, 24 March 2008. Reply to this.
Thanks for very useful article. I really enjoyed reading all of your posts. It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more. So please keep up the great work.
#119, Anismodel, Germany, 25 March 2008. Reply to this.
Thanks for the cheat sheet, very good site !
#120, chat, Unknown, 28 March 2008. Reply to this.
Google suck for whacking your PR. Your cheat sheets are legendary.
#121, Joe Splogs, United Kingdom, 29 March 2008. Reply to this.
regular expressions have always baffled me. thanks for this guide.
#122, rent back, United Kingdom, 1 April 2008. Reply to this.
I cannot regex this: date=2008-04-06,time=08:54:55
to equal this: 2008-04-06 08:54:55
#123, Keith, Unknown, 8 April 2008. Reply to this.
Lovely! Thank you.
#124, Fensterfolie, Unknown, 9 April 2008. Reply to this.
http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/
Please send me all the pictures with regular expressions
Best regards, Leonid.
#125, Leonid Sigarev, Ukraine, Unknown, 24 April 2008. Reply to this.
mailto:sls@uol.ua
#126, Leonid Sigarev, Ukraine, Unknown, 24 April 2008. Reply to this.
i want to write a regular expression to find two or special characters in the string and should have atleast one character (such has a-z and 0-9).
please send me all the pictures with regular expression
Regards
Manish
#127, manish, United States, 25 April 2008. Reply to this.
Great articles.
Thank you
#128, Chat, Turkey, 28 April 2008. Reply to this.
there are some good tools that generate them automatically, but this is for print! Thanks!
#129, Sohbet odas?, Turkey, 28 April 2008. Reply to this.
I had trouble finding this information on the Internet!
Thank you for taking the time to post!
#130, voyance, Unknown, 10 May 2008. Reply to this.
Thanks you. I love Regular Expressions too.
#131, Artikelverzeichnis, Germany, 15 May 2008. Reply to this.
Hi, this is exactly what I needed. I never actually liked RegEx until I came across your cheat sheet. Thanx a lot!
#132, Webdesigner, Germany, 16 May 2008. Reply to this.
Thank you.
I've dowloaded all cheet sheets and printed to put on wall :)
#133, Eugene, Ukraine, 30 May 2008. Reply to this.
It will be assumed that the root will always be the first
part of the file name, and the date portion will be the last
part of the file name
#134, Bogensport Artikel, Germany, 1 June 2008. Reply to this.
Nooooooooo!! why oh why didn't I know about these a couple years ago!! Doh! :D
These are all such a useful reference. You have done a great job, thank you! :D
I created a few text ones for myself, but these are much better. I will highly recommend them (and your very interesting blog by the way) to all I think will find it useful.
Cheers from the land of Aus! :D
#135, Kryten42, Australia, 4 June 2008. Reply to this.
Dude If you have visual studio you can look at a couple of expressions made in the VS Validation code to get an idea of the minor differences...
#136, football, Unknown, 4 June 2008. Reply to this.
Thank you for taking the time to publish this information very useful!
#137, Voyance par telephone, France, 5 June 2008. Reply to this.
Thank you guys
#138, Oyunlar1, Turkey, 9 June 2008. Reply to this.
Great work.
#139, Deep, India, 13 June 2008. Reply to this.
Really great resource, especially for people like me that have a bad memory, something like this is pure gold.
Thanks for taking the time to make it and share it
#140, voyance, Unknown, 13 June 2008. Reply to this.
My students and myself love your cheat sheet!
Thank you ;)
#141, Tiben, France, 22 June 2008. Reply to this.
Thats super awesome sheet..
Thanks
#142, sam flowers, jr, Unknown, 27 June 2008. Reply to this.
This article is very great. This cheat sheet is wonderfull. Simple and very usefully. Thanks.
#143, indir, Unknown, 29 July 2008. Reply to this.
That´s what I was searching for Thank you!
Ulli
#144, SITS, Unknown, 5 November 2008. Reply to this.
Thanks for this, helped a lot in customising my php design.
#145, Wanda, Germany, 26 November 2008. Reply to this.
thx for the great stuff
#146, Bauer, Germany, 13 January 2009. Reply to this.
I do have problem with Regular Expressions, but this cheat sheet is a big help. Thanks!
#147, Mexabet, Australia, 22 February 2009. Reply to this.
Thank you for taking the time to publish this information very useful!
#148, voyant, Unknown, 28 February 2009. Reply to this.
jup very good informations,thanx for this great article :-)
#149, Smart_Head, Austria, 11 April 2009. Reply to this.
This is a great resource which is really really helpful
#150, Mark Paul, Unknown, 13 April 2009. Reply to this.
Thanx for this very useful and informative article, nice work!
#151, Infos, Unknown, 3 May 2009. Reply to this.
Thank you for taking the time to publish this information very useful!
#152, Oteller, Oteller, turizm acentalar?, 2 July 2009. Reply to this.
Thumbnail highlighting Groups and Ranges section. Groups and ranges are very very useful. Ranges are perhaps the easiest place to begin. They allow you to specify a selection of characters to match. For example, if you wanted to see if a string contained hexadecimal characters (zero to nine and a to f), you would use this range:
#153, Yat Kiralama, yat kiralama fiyatlar?, 2 July 2009. Reply to this.
I do have problem with Regular Expressions, but this cheat sheet is a big help. Thanks!
#154, tatil hotel, Unknown, 2 July 2009. Reply to this.
jup very good informations,thanx for this great article :-)
#155, Haberler, Unknown, 2 July 2009. Reply to this.
with Regular Expressions, but this cheat sheet is a big help. Thanks!
#156, perfect, Unknown, 5 July 2009. Reply to this.
Thanks for this and the many other wonderful cheatsheets and articles.
#157, svend, United States, 7 July 2009. Reply to this.
Regular Expressions, but this cheat sheet is a big help. Thanks!
#158, konteyner, Unknown, 22 July 2009. Reply to this.
They allow you to specify a selection of characters to match. For example, if you wanted to see if a string contained hexadecimal characters (zero to nine and a to f), you would use this range:
#159, Prefabrik Evler, Unknown, 6 August 2009. Reply to this.
This is a great resource which is really really helpful
#160, DekDmusic, Unknown, 26 August 2009. Reply to this.
great job everybody need this information
#161, emko, Turkey, 23 October 2009. Reply to this.
oo thanks :)
very good information
Lg uwe from Kleve , Germany
#162, partyshqip, germany, 5 January 2010. Reply to this.