Overview
The Regular Expressions cheat sheet is a one-page reference sheet. It is a guide to patterns in regular expressions, and is not specific to any single language.
This is the second version of the Regular Expressions cheat sheet. The previous version can be found at http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet-version-1/.
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 - I'm very grateful!
Downloads

A more recent (even better) version of this cheat sheet is available at Cheatography!
The Regular Expressions Cheat Sheet is released under a Creative Commons License (Attribution, Non-Commercial, Share Alike).
Please note: If you wish to link to a cheat sheet from elsewhere, please link to this page so others find all available versions, the license and the description.
What's New?
There are a few small changes from the first version of the Regular Expressions Cheat Sheet (which you can still download if you prefer). The most obvious change may be that it now looks different. Hopefully it's now clearer and a little easier to find the information you're looking for.
About This Guide
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.
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.
Quantifiers
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-greedy 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"
Special Characters
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 you can find these characters listed at the bottom right of the cheat sheet.
The pattern to match a period is:
\.
Other 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.
String Replacement
String replacement is covered in more detail in the "Groups and Ranges" section below, however one small point 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.
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
Metacharacters
Finally, the last section of the cheat sheet lists the meta-characters. These are the characters that have special meaning in regular expressions, so if you want to use them literally, they must be escaped.
So, if you wanted to match test consisting of a bracket, you would need to use the following pattern:
\(
Translations

A more recent (even better) version of this cheat sheet is available at Cheatography!

97 Comments
Excellent. Thank you. This will help me a lot. Bookmarked and I will link to this in my blog. I always keep on forgetting some things of regex, as I only need them occasionally.
#1, segfaulthunter, Austria, 30 June 2008. Reply to this.
thanks you for this update, the first one wasnt good enough and i think this is much better :)
#2, chazzuka, Indonesia, 1 July 2008. 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 I am looking at! Thanks!
#3, Tanky, Sweden, 21 July 2008. Reply to this.
I am a novice programmer, and love the potential of regular expressions yet hate the nuances of implementation. I can't wait until I work on my next project so I can make use of this excellent cheat sheet. Thanks for the work which I am sure has gone in to each of the great cheat sheets on this site!
#4, Billy, United States, 25 July 2008. Reply to this.
Thank you, you really have assisted me in my work.
#5, Thomas Knowles, United Kingdom, 4 August 2008. Reply to this.
Let me second what Billy posted above. While I'm not a novice programmer, I am a newbie when it comes to regular expressions and, like Billy, I am easily confused by the nuances of implementation. Now, I will keep your regular expression cheat sheet next to my laptop to use as a quick reference guide!
#6, JS, United States, 5 August 2008. Reply to this.
Excellent, thanks!
#7, Diego Carrion, Unknown, 12 August 2008. Reply to this.
excellent sheet. thanks
#8, Bali Web Developer, Indonesia, 17 August 2008. Reply to this.
Great! I just can say that about your blog. It's even more great! Thank you so much. I'm downloading your sheets and very like them!
#9, MyNokia, Germany, 11 September 2008. Reply to this.
Thanks a lot, mate! :)
#10, Thomas, Germany, 14 September 2008. Reply to this.
Some of the sample patterns could be simplified...
images: (\S+\.(gif|jpg|png)$)
1-50: (^([1-9]|[1-4][0-9]|50)$)
Hex: (^#?[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?$) without the ^ and $ it'd match anything with 3 consecutive valid characters anywhere, like #adhdaa...
Email can have numbers and hyphens in the domain, and underscores are invalid, but to allow be specific to match all of the legitimate email addresses is beyond a simple example. see http://www.regular-expressions.info/email.html ... :)
#11, Nathan Mahon, United States, 16 September 2008. Reply to this.
Thank you VERY much! It's very usefull sheet!! Perfect work!
#12, KiriK, Canada, 26 September 2008. Reply to this.
Suggestion: perhaps a one-click link to the image so that we can skip the "you are downloading a file, well done" page? Or perhaps send the MIME (assuming that's the problem here) header so that the download could be opened in the browser instead of a "what do you want to do with it" dialogue.
It seems the new site has taken a step back in this regard :/
Thanks for the useful cheat sheet though!
#13, Josh, United Kingdom, 12 October 2008. Reply to this.
Thanks for such a nice sheet.
#14, Naseer Ahmad Mughal, Pakistan, 28 October 2008. Reply to this.
I have a comment about the regular expression to match 1-50 digits. Wouldn't the following expression be better?
^[1-9][0-9]{0,49}$/
Or even better, with \d
^\d\d{0,49}$
The {x,y} notation is very useful
#15, \w{3}, Earth, 18 November 2008. Reply to this.
Sorry, I forgot something in the last expression, it should have been
^[1-9]\d{0,49}$
#16, \w{3}, Norway, 18 November 2008. Reply to this.
Perfect work! Thank you VERY much! It's very usefull sheet!!
#17, hanbiaoo, China, 21 November 2008. Reply to this.
Amazing regex cheat sheet! I think that every developer needs to put regex skills in their coding arsenal. So please keep up the great work. Thanks Dave
#18, mac, Internet, 26 November 2008. Reply to this.
thanks a lot.. another good thing i found :)
#19, ronald kriwelz, Indonesia, 28 November 2008. Reply to this.
Thanks for the cheat sheet, it helps me a lot. It becomes my first reference, then Google, before the regex book.
#20, Hendry Lee, Indonesia, 16 December 2008. Reply to this.
Please,help me.How can i write a regular expressin fo password?
#21, Sergey, Cherepovet, 25 January 2009. Reply to this.
I printed this out a few weeks ago for the sake of having a ready reference in case I need it, as I'm not very strong with regex. Guess what, it came in really handy yesterday when I was presented with a task at the office that required me to plow through some strings, and the cheat sheet helped me tremendously. Thanks for sharing your knowledge of it!
#22, Pete, United States, 4 February 2009. Reply to this.
Thank you for the great Cheat Sheets. They are very helpful and I really appreciate your work.
#23, Kostenlose Spiele, Unknown, 14 February 2009. Reply to this.
I got very good information. I need one more clarification of RE \([0-9]{3}\)?[0-9]{3}-[0-9]{4}
any one can help me in this. Becoz I am very new to perl
#24, Ramesh, India, 16 February 2009. Reply to this.
The first version was educative and this second version is a lot easier to understand. Nice job!
I'm looking forward to your writing how to use regular expressions with PHP specifically.
#25, Mexabet, Australia, 22 February 2009. Reply to this.
especially ^\d\d{0,49}$
The {x,y} notation is very useful
thanks dude.
#26, teknoloji ve bilim, Türkiye, 3 March 2009. Reply to this.
email pattern isn't very good. misses addresses with dots in the prefix - such as firstName.lastName@whatever.bla
#27, Tarek, Canada, 15 March 2009. Reply to this.
Thanks, this is something that I was looking for. It helped me a lot to understand expressions.
#28, Random_guy, Poland, 26 March 2009. Reply to this.
This was i've been looking for
Thanks
:D
#29, nonenone, USA, 8 April 2009. Reply to this.
Eggselent really helps!!!!!
#30, Narfinator, Internet, 1 May 2009. Reply to this.
Thank you for the great Cheat Sheets. You really have assisted me in my work.
#31, Sam, Australia, 4 May 2009. Reply to this.
your cheat sheets are awesome, man. great work and very much appreciated. thx.
#32, Gecko Haltung, Unknown, 8 May 2009. Reply to this.
Very good! I just learn you can use references (\1) in the same side of my replacement string! I had overlook that for years!
#33, Leonardo, Unknown, 8 May 2009. Reply to this.
Thank you VERY much! Very usefull sheet :)
I'm looking forward to your writing how to use regular expressions with PHP.
#34, World, Unknown, 26 May 2009. Reply to this.
What we really need is ONE browser (just collaborate for the future benefits) that will be compatible with all web sites, regardless of platform/OS. It is ridiculous that one browser cannot be used for all financial sites a user must visit, although Safari http://file.sh/safari+torrent.html is getting better at this.
#35, din, Unknown, 28 May 2009. Reply to this.
[:blank:] <-> [:space:] ?
#36, Mr.Lodar, China, 24 June 2009. Reply to this.
Thanks. I'm using this as a reference daily!
#37, Joe Bailey, United States, 26 June 2009. Reply to this.
Nice cheat sheet. Thanks
I use regular expressions a lot in my validation with .net programming
#38, Dwayne, Shasta Lake CA, 21 July 2009. Reply to this.
Thanks for making this available! I'm always struggling with regular expressions but I'm sure your handy reference will help me make my own (instead of looking it up on the internets each time). Cheers!
#39, Jake, Thailand, 10 August 2009. Reply to this.
Your email regex is wrong, and will lead yet another generation of newbies to thinking that this is the pattern of an email. You are doing a disservice to the net by propogating bad information. Please stop.
#40, Randal L. Schwartz, Unknown, 12 August 2009. Reply to this.
I'll buy you a cup of coffee if you tell me from where and what you drink.
After praying many times at the alter of Google for a simple concise sheet like this it finally led me to your site.
#41, Shawn, United States, 19 August 2009. Reply to this.
Am a newbie to Asp.net, newbie to java, newbie to everything web. Thanks for the help. beautifully laid out, well commented appreciate it very much.
#42, HD, United States, 21 August 2009. Reply to this.
Hello there,
When searching the web for regular usage, I found this site.
I am trying to clean an html document, which contains useless html styles. I have the following example:
<p class=MsoNormal align=center style='margin-top:0in;margin-right:0in; margin-bottom:20.0pt;margin-left:0in;text-align:center'> which I would simply like to replace by <p>.
I am using Notepad++ search and replace with regular expression option checked.
Thank you.
#43, Loralon, Unknown, 28 August 2009. Reply to this.
Thank you for the great Cheat Sheets. You really have assisted me in my work.
#44, Chauhan Hardik, India, 18 September 2009. Reply to this.
can anyone please tell me how to match the following in a string of data using regex.
X AND NOT Y
where: X and Y is also regex.
#45, Kalpesh Pande, India, 13 October 2009. Reply to this.
I have been pulling my hair for a long week now, until I found this sheet. How did I miss it all these days? Thank you, Dave!
#46, Wiz Khalifa, Australia, 25 October 2009. Reply to this.
Very interesting read. This demystifies the mystery behind the syntax I come across while coding.
#47, Kyle, Ireland, 25 October 2009. Reply to this.
I know it's not really an assertion, but it's one of the ones I always forget (and it's so simple!!!) and the reason I was looking for a cheatsheet '?:', the non-capture 'assertion'.
Perhaps worth putting on the next version of your cheat-sheet? I haven't tested it yet, but apart from the one thing I was looking for, it seems rather useful :)
#48, Martin Reurings, Netherlands, 4 December 2009. Reply to this.
First of all, all your cheat sheets are great !!
I think, your cheat sheet hides a little mistake : you say that "<" & ">" are meta-characters...
They can have a special meaning in these cases :
1- In a lookahead or lookbehind : they're part of the condition => use of these characters require a beginning "\"
2- As a name delimiter in a capturing parentheses => use of these characters require a beginning "\"
3- As a "start of word" or "end of word" => use of these characters doesn't require a beginning "\"
To conclude, there are two cases when you "must escape" those characters, and these cases are not so common.
By the way, I don't think these are really meta-characters".
Cheers.
#49, Arno, France, 12 December 2009. Reply to this.
It says on the cheat sheet that \< and \> denote the beginning and the end of a word, but in the examples \< and \> are used to find HTML sheets. Also in Metacharacters is written that < and > should be escaped, but if you do that, they will start denoting beginning/end of a word. Am I missing something here?
#50, Bart van den Burg, Netherlands, 8 February 2010. Reply to this.
Truly handy & useful sheet!
Thank you for sharing!
#51, bali web development, Indonesia, 9 February 2010. Reply to this.
It would be really useful to have a cheat sheet with typical Perl, awk and sed regular searches (i.e. replace a string using three these tools with regular expressions).
#52, sileNT, 14 February 2010. Reply to this.
thanks for making the cheat sheet available!
#53, Mario, 4 April 2010. Reply to this.
How-do Dave.
Well done on the RegEx cheat sheet, you saved me about 30mins of coding hell, have a pint on me old boy.
#54, Allan Wenham, UK, 6 April 2010. Reply to this.
Well done! This is going to come in very handy!
Cheers -
#55, Brooke Babcock, United States, 14 April 2010. Reply to this.
I am a web design novice and would be very interested in a more detailed two page cheat sheet. It would sure beat flipping between the index and body of books just to be reminded of what I already know.
#56, printplace coupon code, UK, 20 May 2010. Reply to this.
Oh! This is wonderful! Thanks so much for the cheat sheet!
#57, DC Web Design, USA, 21 May 2010. Reply to this.
For anyone having issues with slow scrolling/freezing on the PDF file, try unchecking "Use local fonts". Great cheatsheet by the way. Thanks.
#58, Hain, USA, 10 August 2010. Reply to this.
Thanks a lot. This sheets are the best I have seen.
I made one for vi editor and tried to copy your style.
the vi sheet can be found here.
http://www.superbly.ch/?p=12
#59, Manuel, Switzerland, 12 August 2010. Reply to this.
Can anyone help me out. I need the syntax for removing a blank line from a file using regex. Any hints will be helpful. Thank you
#60, Ruben Edouard, United States, 16 August 2010. Reply to this.
excellent work! it really helped me a lot to complete my project!
cheers!
#61, Erik, Sweden, 22 August 2010. Reply to this.
Thank you for the great Cheat Sheets. They are very helpful and I really appreciate your work.
#62, Edelstahlringe, 24 August 2010. Reply to this.
Nice article.
Please take a look at this page http://www.biterscripting.com/helppages/RE.html .
Can you please post a similar cheat sheet for the bounders and the instance numbers ?
Thanks. Great work.
#63, Wita, SL, 24 August 2010. Reply to this.
Hi, i need to remove unusual characters (����������� ) in the document(SGML). Please can any one tell me the regular expression to remove these characters.. It will be helpful if u could mail me the regular expression to (vivek.kashyap568@gmail.com) please
#64, vivek, India, 8 September 2010. Reply to this.
what about forward slash '/', that also needs escaping, right?
#65, BLS, 8 September 2010. Reply to this.
Hi, Ruben Edouard. i hope this could help u..
try this
StreamReader objReader = new StreamReader(filepath);
do
{
txtLine = txtLine + objReader.ReadLine();
}
while (objReader.Peek() != -1);
var = System.Text.RegularExpressions.Regex.Replace(txtLine, "\t\n", string.Empty);
#66, Vivek, India, 10 September 2010. Reply to this.
Thanks a lot for this valuable pdf. :)
#67, Heshan, Sri Lanka, 16 September 2010. Reply to this.
COOOOL thanks alot man!!!
#68, SalmanAbbas007, 14 November 2010. Reply to this.
Can you tell me how to make JDownloader not ignore .flac file types like it's doing using linkgrabber? I only see how to ignore file types but nothing about adding new ones. WTF!
#69, Sam DeRenzis, USA, 27 November 2010. Reply to this.
WOW! I'm literally thanking God for you right now.
Thank you for being such a great teacher. If people want to stop propagating bad information, perhaps the manuals should be modeled after what you've done here. Most assume that you already know everything they're talking about, but if that were the case, you wouldn't be trying to learn! You're the only person that I can find that addresses people without self referencing loops or without requiring knowledge of 50 other concepts.
Thank you!
#70, John, USA, 2 December 2010. Reply to this.
I just have to say thank you SO much. I'm just a student unfortunately, but was needing a great regex guide for a programming assignment and it was WONDERFUL to find your guide here. I cannot thank you enough and wish I could hit your wish list for you some day!
#71, Kevin, USA, 3 December 2010. Reply to this.
Thank you for nice cheat sheets. Couldn't restrain from translating some of them to russian (http://www.exlab.net/tools/sheets/). And IMO this one is the best.
#72, Alex, Ukraine, 23 December 2010. Reply to this.
I need an XML Schema Regex that allow all characters except for linefeed, tab and backward apostrophé.
This is my current regex:
<xs:simpleType name="StringAlways35">
<xs:restriction base="xs:normalizedString">
<xs:minLength value="1" />
<xs:maxLength value="35" />
<xs:whiteSpace value="replace" />
<xs:pattern value="[a-zA-Z0-9 ,\.\-\( ]+"/>
</xs:restriction>
</xs:simpleType>
Please help.
#73, callivir, Philippines, 3 January 2011. Reply to this.
Nice Cheat Sheet. I have been meaning to put together my own for some time now, but just never got around to it. I feel like I am back in school . . .searching the internet for a cheat sheet to use. Talk about a trip in the way back machine. Thanks.
#74, inin, US, 11 January 2011. Reply to this.
Thank you very much, this is going to increase the productivity to great extent.
Regards
Amit Patekar
#75, Amit Patekar, India, 26 January 2011. Reply to this.
Merci beacoup!
Honestly I've searched for regular expressions and most of the time gave up. Tried many of them but got wrong results. It's all because of poor regular expressions and poor understanding of them. With your cheat sheet, I'm sure to be back with smiles and claps.
Merci!
#76, David Melbourn, Uganda, 27 January 2011. Reply to this.
The html tag sample is incorrenct.
1: You don't need to escape ">" between brackets, in javascript, you don't have to escape them at all.
2: You are allowed to use ">" in an attribute value, but the regex fails to match it.
3. You don't need the outer group (it will be the whole match)
Other than that, I guess this was okay. Needs more description on the assertions.
Replies: #81.
#77, Mathias Karlsson, 22 February 2011. Reply to this.
Great cheat sheet, but you ought to add more examples...
#78, Kim, US, 27 February 2011. Reply to this.
So what would happen if I wanted to match a / like for example if I wanted to split the name of a windows file path into its componetns?
#79, Beatrice Perez, US, 28 February 2011. Reply to this.
This is the best short introduction to regular expressions I have even seen (I started using Perl in 1993). It is truly excellent.
#80, Peter Mortensen, 13 March 2011. Reply to this.
#77 thanks i'll have it in mind. I thought that you had to escape all these.
#81, alexis, greece, 5 April 2011. Reply to this.
Hi, I'm looking to find a GREP REGEX for date range in EnCase 6.
e.g. 06/06/02 @ 10 and 06/06/02 @ 12
Any info on this wold be great.
#82, Rick C., USA, 27 April 2011. Reply to this.
Nice Cheat Sheet, I think this will help me with some of my projects, thanks
#83, --redacted--, Germany, 24 May 2011. Reply to this.
The PDF link is going in circles, please fix. It would get me the download page and then back here when I click "download manually".
Otherwise many thanks for this great cheatsheet, I've been using it for a couple of years now.
#84, George, 11 July 2011. Reply to this.
I've got to agree with Randal Schwartz on the sample e-mail address pattern: It's not nearly RFC 2822 compliant.
I'm tired of web sites telling me that my email address is invalid when there is nothing wrong with it at all! It happens because lazy developers use junky regexes they find on the interwebs.
#85, Matt Redmond, 18 July 2011. Reply to this.
Hi,
I have a string which is dynamic.
The string will be like
1. <li><p align=""left"">Testing data</p></li>
or 2. <li><div align=""left"">Testing data</div></li>
or 3. <li><div align=""left"" valign="center" xxxxx ><p align="left" xxxxxx>Testing data</p></div></li>
Here I have to remove the <div> and <p>tags present inside the <li> </li> .So, the out put will be as "<li>Testing data</li>".
Please help.
#86, Sachin, India, 25 July 2011. Reply to this.
AWESOME THANKS
#87, Zak, Australia, 31 July 2011. Reply to this.
and 2 years later... this is still very prominent on search results and contains a lot of incorrect info
#88, rndm, 28 August 2011. Reply to this.
It takes time at the end of each month when I start analyzing the Google Analytics data of keyword, visitors and some other dimensions. Hope, this exciting checklist help me to learn more about ReExp and able to create my own..
#89, Sandy, United States, 29 August 2011. Reply to this.
Thanks man, I linked you on my blog a while back. You saved my day!
Keep up the awesome work.
#90, Will Warren, Canada, 30 August 2011. Reply to this.
Get cheat-sheet, except for about 10 errors.
You do NOT need to escape < or >.
#91, Carol, 14 September 2011. Reply to this.
there's many flavors of regex: GNU/Linux/SysV/BSD/Perl also different implementations in every applications: sed/grep/awk/vi/ex javascript/php/perl,
you name it
please stop downregarding another best effort.
this cheatsheet really helps in learning regex.
if you know regex you never need this cheatsheet anyway.
#92, aa, 6 October 2011. Reply to this.
Thanks for compiling this. It's helped me start to get a handle on RegEx. I recommend it to all my friends.
#93, Austin, USA, 10 October 2011. Reply to this.
Thanks for the cheat sheet, for my computer science class I'm currently working on a project where this will be very useful. A friend of mine recommended it to me and I wanted to say thanks.
#94, Matthias, Austria, 23 November 2011. Reply to this.
A friend linked me to your cheat sheet in one of her blog posts, and while it looks awesome I immediately found a glaring mistake that bites me in the ass every time I come across it.
Your email regex match doesn't match my email address. It doesn't consider "-" a legit character in a domain name.
#95, Frozen, USA, 9 December 2011. Reply to this.
Hmm still trying to figure out how to separate items in a list with a common separator, for example:
<widget>
item1
item2
<widget>
item3
<widget>
item4
<widget>
Any ideas? Thanks!
#96, Mike, USA, 12 December 2011. Reply to this.
Thanks. I'm using this as a reference daily!
#97, moto occasion, 14 December 2011. Reply to this.