Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[p6-regex-quick-ref] quantifiers, conjunctions and disjunctions

  • Loading branch information...
commit 16307e9a8cc54d49b147311cba9d32cb7c85813e 1 parent c6502a0
Moritz Lenz authored July 31, 2009

Showing 1 changed file with 18 additions and 0 deletions. Show diff stats Hide diff stats

  1. 18  quick-ref/p6-regex-quick-ref.pod
18  quick-ref/p6-regex-quick-ref.pod
Source Rendered
@@ -16,6 +16,24 @@ All other characters preceded by a backslash are literal.
16 16
     <...>   Assertion (does this thing match?)
17 17
     :...    introduces a modifier
18 18
 
  19
+=head2 Quantifiers
  20
+
  21
+Quantifiers specify how often the preceeding term has to match. There is a
  22
+non-greedy variant of each quantifier which you get by appending a question
  23
+mark C<?> to the quantifier
  24
+
  25
+    ?               zero or one match
  26
+    *               at least zero matches
  27
+    +               at least one match
  28
+    ** NUM          exactly NUM matches
  29
+    ** NUM1..NUM2   NUM1 to NUM2 matches
  30
+
  31
+=head2 Conjuctions and disjunctions
  32
+
  33
+    A |  B     match A or B; longest match wins
  34
+    A || B     match A or B; first match wins
  35
+    A &  B     match A and B with same length
  36
+    A && B     match A and B with same length; guarentueed order of execution
19 37
 
20 38
 =head2 Assertions
21 39
 

0 notes on commit 16307e9

Please sign in to comment.
Something went wrong with that request. Please try again.