{"id":2853,"date":"2012-12-04T00:02:27","date_gmt":"2012-12-03T23:02:27","guid":{"rendered":"http:\/\/www.icantinternet.org\/?p=5"},"modified":"2016-05-02T08:59:24","modified_gmt":"2016-05-02T08:59:24","slug":"regular-expressions-cheatsheet","status":"publish","type":"post","link":"https:\/\/beheydt.be\/nl\/regular-expressions-cheatsheet\/","title":{"rendered":"Spiekbriefje voor Reguliere Expressies"},"content":{"rendered":"<p><!--adsense--><\/p>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>^<\/td>\n<td>Start of string<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>Start of string<\/td>\n<\/tr>\n<tr>\n<td>$<\/td>\n<td>End of string<\/td>\n<\/tr>\n<tr>\n<td>Z<\/td>\n<td>End of string<\/td>\n<\/tr>\n<tr>\n<td>b<\/td>\n<td>Word boundary<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>Not word boundary<\/td>\n<\/tr>\n<tr>\n<td>&lt;<\/td>\n<td>Start of word<\/td>\n<\/tr>\n<tr>\n<td>&gt;<\/td>\n<td>End of word<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>c<\/td>\n<td>Control Character<\/td>\n<\/tr>\n<tr>\n<td>s<\/td>\n<td>White Space<\/td>\n<\/tr>\n<tr>\n<td>S<\/td>\n<td>Not white Space<\/td>\n<\/tr>\n<tr>\n<td>d<\/td>\n<td>Digit<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>Not digit<\/td>\n<\/tr>\n<tr>\n<td>w<\/td>\n<td>Word<\/td>\n<\/tr>\n<tr>\n<td>W<\/td>\n<td>Not word<\/td>\n<\/tr>\n<tr>\n<td>x<\/td>\n<td>Hexadecimal digit<\/td>\n<\/tr>\n<tr>\n<td>O<\/td>\n<td>Octal digit<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>?=<\/td>\n<td>Lookahead assertion<\/td>\n<\/tr>\n<tr>\n<td>?!<\/td>\n<td>Negative lookahead<\/td>\n<\/tr>\n<tr>\n<td>?&lt;=<\/td>\n<td>Lookbehind assertion<\/td>\n<\/tr>\n<tr>\n<td>?!= or also ?<!--<\/td--><\/td>\n<td>Negative lookbehind<\/td>\n<\/tr>\n<tr>\n<td>?&gt;<\/td>\n<td>Once-only Subexpression<\/td>\n<\/tr>\n<tr>\n<td>?()<\/td>\n<td>Condition [If Then]<\/td>\n<\/tr>\n<tr>\n<td>?()|<\/td>\n<td>Condition [If Then Else]<\/td>\n<\/tr>\n<tr>\n<td>?#<\/td>\n<td>Comment<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>*<\/td>\n<td>0 or more occurences<\/td>\n<\/tr>\n<tr>\n<td>+<\/td>\n<td>1 or more occurences<\/td>\n<\/tr>\n<tr>\n<td>?<\/td>\n<td>0 or 1 occurences<\/td>\n<\/tr>\n<tr>\n<td>{5}<\/td>\n<td>Exactly 5 occurences (or any other number instead of 5)<\/td>\n<\/tr>\n<tr>\n<td>{5,}<\/td>\n<td>5 or more occurences<\/td>\n<\/tr>\n<tr>\n<td>{5,8}<\/td>\n<td>5, 6, 7 or 8 occurences<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>x?<\/td>\n<td>Ungreedy version of &#8220;x&#8221;, where x is a quantifier (see before)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>\/<\/td>\n<td>Escape one character<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td colspan=\"6\">Note that all of these characters need to be escaped (see escape character above)<\/td>\n<\/tr>\n<tr>\n<td>^<\/td>\n<td>$<\/td>\n<td>(<\/td>\n<td>)<\/td>\n<td>&lt;<\/td>\n<td>&gt;<\/td>\n<\/tr>\n<tr>\n<td>[<\/td>\n<td>{<\/td>\n<td><\/td>\n<td>|<\/td>\n<td>.<\/td>\n<td>*<\/td>\n<\/tr>\n<tr>\n<td>+<\/td>\n<td>?<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>g<\/td>\n<td>Global match<\/td>\n<\/tr>\n<tr>\n<td>i<\/td>\n<td>Make case-insensitive<\/td>\n<\/tr>\n<tr>\n<td>m<\/td>\n<td>Match multiple lines<\/td>\n<\/tr>\n<tr>\n<td>s<\/td>\n<td>Treat a string as a single line<\/td>\n<\/tr>\n<tr>\n<td>x<\/td>\n<td>Allow the occurence of whitespace and comments in the string<\/td>\n<\/tr>\n<tr>\n<td>e<\/td>\n<td>Evaluate the replacement<\/td>\n<\/tr>\n<tr>\n<td>U<\/td>\n<td>Use an Ungreedy pattern<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>n<\/td>\n<td>Newline<\/td>\n<\/tr>\n<tr>\n<td>r<\/td>\n<td>Carriage return<\/td>\n<\/tr>\n<tr>\n<td>t<\/td>\n<td>Tab<\/td>\n<\/tr>\n<tr>\n<td>v<\/td>\n<td>Vertical tab<\/td>\n<\/tr>\n<tr>\n<td>f<\/td>\n<td>Form feed<\/td>\n<\/tr>\n<tr>\n<td>xxx<\/td>\n<td>Octal character xxx<\/td>\n<\/tr>\n<tr>\n<td>xhh<\/td>\n<td>Hex character hh<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>.<\/td>\n<td>Matches all characters except newline<\/td>\n<\/tr>\n<tr>\n<td>(x|y)<\/td>\n<td>Matches x or y<\/td>\n<\/tr>\n<tr>\n<td>(&#8230;)<\/td>\n<td>A group, matches the group exactly (xyz) matches &#8216;xyz&#8217;<\/td>\n<\/tr>\n<tr>\n<td>(?:&#8230;)<\/td>\n<td>Lazy group, matches every occurence of group, not only the first and the last (as greedy does)<\/td>\n<\/tr>\n<tr>\n<td>[xyz]<\/td>\n<td>Range, matches x, y or z<\/td>\n<\/tr>\n<tr>\n<td>[^xyz]<\/td>\n<td>Negative range, matches NOT x, y or z<\/td>\n<\/tr>\n<tr>\n<td>[a-z]<\/td>\n<td>Matches any letter between a and z<\/td>\n<\/tr>\n<tr>\n<td>[A-Z]<\/td>\n<td>Matches any upper case letter between a and z<\/td>\n<\/tr>\n<tr>\n<td>[0-9]<\/td>\n<td>Matches any number between 0 and 9 (digit)<\/td>\n<\/tr>\n<tr>\n<td>x<\/td>\n<td>Matches the &#8220;x&#8221;-th occurence of the pattern<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>$x<\/td>\n<td>Replaces &#8220;x&#8221;-th non-passive group that matches<\/td>\n<\/tr>\n<tr>\n<td>$2<\/td>\n<td>Replaces &#8220;def&#8221; in \/^(abc(def))$\/<\/td>\n<\/tr>\n<tr>\n<td>$1<\/td>\n<td>Replaces &#8220;def&#8221; in \/^(?:abc(def))$\/<\/td>\n<\/tr>\n<tr>\n<td>$`<\/td>\n<td>Replaces before the matched string<\/td>\n<\/tr>\n<tr>\n<td>$&#8217;<\/td>\n<td>Replaces after the matched string<\/td>\n<\/tr>\n<tr>\n<td>$+<\/td>\n<td>Replaces the last matched string<\/td>\n<\/tr>\n<tr>\n<td>$&amp;<\/td>\n<td>Replaces the entire matched string<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!--adsense--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>^ Start of string A Start of string $ End of string Z End of string b Word boundary B Not word boundary &lt; Start of word &gt; End of word c Control Character s White Space S Not white Space d Digit D Not digit w Word W Not word x Hexadecimal digit O [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16,36],"tags":[],"class_list":["post-2853","post","type-post","status-publish","format-standard","hentry","category-internet","category-webmaster"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pbkKxJ-K1","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/posts\/2853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/comments?post=2853"}],"version-history":[{"count":0,"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/posts\/2853\/revisions"}],"wp:attachment":[{"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/media?parent=2853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/categories?post=2853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beheydt.be\/nl\/wp-json\/wp\/v2\/tags?post=2853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}