Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Match everything enclosed
    (?:...)
  • Capture everything enclosed
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
g

Test String

Substitution

Processing...

Code Generator

Generated Code

$re = '/[(\w+\s)+.,-]{100,}/'; $str = ' ????>??(*????\'?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? bjbj?>?>.?T?T?????????????$000000???????$D??N??00??[[[.00?[?[[[0?????A x???????9[?0[D9"D[D[$[??[????????????????????????????????????????????????????????????????????D? ?:Het socialezekerheidsrecht is een bijzonder ingewikkeld kluwen van diverse regelgevingen op verschillende niveaus. Dit handboek biedt een overzicht van de belangrijkste onderdelen ervan. Na een algemene beschrijving van de structuur, het toepassingsgebied en de financiering van de sociale zekerheid komen achtereenvolgens de verschillende takken van de sociale zekerheid aan bod, zoals de arbeidsongevallen- en beroepsziekteverzekeringen, de ziekteverzekering, de gezinsbijslag, de werkloosheidsverzekering, het wettelijk en het aanvullend pensioen. Er wordt ook aandacht geschonken aan de socialebijstandregelingen, zoals het leefloon, de inkomensgarantie voor ouderen enz.Op deze wijze biedt dit boek een eerste kennismaking met het socialezekerheidsrecht. Dit onderdeel van de sociale wetgeving is bij uitstek het domein waarin vrijwel dagelijks wijzigingen worden aangebracht. Daarom zullen via de website van Intersentia (www.intersentia-educatief.be) actualiseringen worden aangereikt tot aan de publicatie van een volgende editie. Ook het hoofdstuk over jaarlijkse vakantie en een uitgebreid pakket van elektronische oefeningen staan ter beschikking van de docenten die het handboek als lesmateriaal invoeren. Daarnaast vinden ze op dezelfde website ook een powerpointpresentatie. ??h{ah??h{a ?$a$gd{a,1?h??. ??A!??"??#??$??%???????j?????????666666666vvvvvvvvv666666>666666666666666666666666666?6666666666?666666666666hH66666666666666666666666666666666666666666666666666666666666666666?62???? 0@P`p??????2(?? 0@P`p?????? 0@P`p?????? 0@P`p?????? 0@P`p?????? 0@P`p?????? 0@P`p??8X?V~ OJPJQJ_HmHnHsHtHP`??PStandaardd??CJ_HaJmHsHtHLA ???L Standaardalinea-lettertypeVi???V 0Standaardtabel?4? l4?a?.k ???. 0 Geen lijstPK!????[Content_Types].xml???N?0E?H???-J??@%????|??$???U??L?TB? l,?3??;?r??Ø??J??B+$?G]??7O?V??<a??????(7??I??R?{?pgL?=??r????8?5v&????uQ??8??C????X=????$???6N?JC????????F?B.?\'?.?+???Y?T???^e5?5?? ??ð?_?g -??;?????Yl????|6^?N??`?????[??PK!????6_rels/.rels???j?0????}Q??%v/??C/?}?(h"???O? ??????=??????? ????C??h?v=?????%[xp??{?_?P?<?1?H?0???O?R?Bd???JE?4b$??q_????6L??R?7`???????0?O??,?En7?Li?b??/?S???e?????????PK!ky???theme/theme/themeManager.xml?M ? @?}?w??7c?(Eb????C?A???????7???K Y,? ?e?.???|,???H?,l????x???I?sQ}#????? ?+?!?,?^?$j=?GW???)?E?+& 8???PK!?2/??theme/theme/theme1.xml?YMoE?#?F{oc\'vGu??HS??-?q?;?fvg53N?j?HH??8P?Tj%.????H??3????$i#ZA}H?????3?z?^??!?????/?<D?4??a?????I?OH??]?x???x]E$&?\'r??H?t}iI?0??e???????G.??--?j?K1??????(????x???DI=?31??;À??????2?1k{?(?GCrOy?a??E?????qu?g??Z0?4?o>?lBp?lt?pT(???+[?|`j?????z!??????F???e?@????n?Yk?????9?[?N???l?B ?~m???j???eo@??7:???7 ?_?????V.?"F??9?Nh??I/ c?+?k_?e? ??(/?b????b|??> 4?aE??)c??Xk?????!_? ieH?????}?b????~x??:?????????? rfm?$,?z???=?????????2??????/????3s?????????????o <*Ç4&?$Gh??????k9???F??gl&???Z*??T??oN1????!no??*???]??A$&?Vh?b??9?pQ?????$???I???a??.N???&)0g^????8f?1`b??(???B*??C??]?.?X?;u0????j?M?1?eZ?3????m?????-r?"?+0?0~H???x?p%r?cV? ??*#S??q=? ?!a?"e???[J??L?.??.R(zP%??????iv@????@@?b??U|????!8Y???8?>? n??1iV ??DT??:?N??l???`u??c??q3 ?m5qU>??Q??o+eo??U?3?\'?z?$=w?????[x??h??%?9?#g8????yQ?_<%?XZ?E?N???????1el????f?-a??0?\'?C\')?ai_u+? l? ???TE???k?{ZH(3?D)?p4Õ?5v??6??b?Cb??;?????F!?X?3m?hE8???+?P??U??Qg?V7?Vt?.??s9??p ?hB? ?A?W??U?i3????i1Y???$??{>Gu???V??~?b?G?S?V???b_C?Y?TV?X?.???d)??Y?@??vdI?9Y???^???????7??2|?S??I?B?o???ej3?.?e??;?6A.?l??vx Rma??0??`??d?_nBX/? 6:?+kPo? ???Z2_??]??????"bGh?&bC?u????p?aA????y??s?t?;1?????V?h??n???<???*m7?????J???g????V?n?F?S????BiD???????????PTpGm?r????2L[?)R?? ?!{@K??NV??.+?e?LE???5{Dj?k??"(u?& ???s???z?S?7???????????N?<l64y????lU????|?-;?_?Y??+@Yi)hem??&?s???5??r37?8?1?.????>#????:????~?? l??/??iG?q?????(?l??/???-?????,?>g???????va\'?vla?!?\'[???I?$??RV?1???B???G?S??R%0??????F3u?o??PK! ???\'theme/theme/_rels/themeManager.xml.rels??M ?0???woo??&?????5 6?$Q?? ?,.?a??i????c2?1h?:??q??m???@RN??;d?`??o7?g?K(M&$R(.1?r\'J???T???8??V?"??A??H?u}???|?$?b{??P????8?g/]?QAs?(????#??L?[??????PK-!????[Content_Types].xmlPK-!????60_rels/.relsPK-!ky???theme/theme/themeManager.xmlPK-!?2/???theme/theme/theme1.xmlPK-! ???\'?theme/theme/_rels/themeManager.xml.relsPK]? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>???? ?8?@????????????0?(? ??B ?S??????Oh??? ??? ?5{a?? ?@??????@??Unknown????????????G??*?Ax??Times New Roman5??Symbol3.??*?Cx??Arial7.?????@?CalibriA????$B?Cambria Math"q??????2Gi:8??E??E????????0J????HP??$P??????????????????????52!xx????Iris RutsIris Ruts???????Oh??+\'??0H????????? (08@?Iris RutsNormalIris Ruts2Microsoft Office Word@??J?@lg????E?????.??+,??0?hp|??????? ???Titel???? ???????? !"#$%&????????)????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Root Entry?????????F`?x???+?1Table???????? DWordDocument????????.SummaryInformation(????DocumentSummaryInformation8????????????CompObj????????????r?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ?????F Microsoft Word 97-2003-document MSWordDocWord.Document.8?9?q'; $subst = ""; $result = preg_replace($re, $subst, $str); echo "The result of the substitution is ".$result;

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php