]> gitweb.factorcode.org Git - factor.git/commitdiff
Documenting character class operations
authorDaniel Ehrenberg <littledan@Macintosh-122.local>
Sat, 21 Mar 2009 08:22:50 +0000 (03:22 -0500)
committerDaniel Ehrenberg <littledan@Macintosh-122.local>
Sat, 21 Mar 2009 08:22:50 +0000 (03:22 -0500)
basis/regexp/regexp-docs.factor

index 01a727d017a5498ee4b7409fa204debbee83bde9..3a914f428312651642ccdce42455bd5db2779e89 100644 (file)
@@ -76,6 +76,8 @@ ARTICLE: { "regexp" "syntax" } "Regular expression syntax"
     { { $snippet "\\p{Nd}" } "Character in Unicode category Nd" } 
     { { $snippet "\\p{Z}" } "Character in Unicode category beginning with Z" } 
     { { $snippet "\\p{script=Cham}" } "Character in the Cham writing system" } }
+{ $heading "Character class operations" }
+"Character classes can be composed using four binary operations: " { $snippet "|| && ~~ --" } ". These do the operations union, intersection, symmetric difference and difference, respectively. For example, characters which are lower-case but not Latin script could be matched as " { $snippet "[\\p{lower}--\\p{script=latin}]" } ". These operations are right-associative, and " { $snippet "^" } " binds tighter than them. There is no syntax for grouping."
 { $heading "Boundaries" }
 "Special operators exist to match certain points in the string. These are called 'zero-width' because they do not consume any characters."
 { $table