|
Perl 6
Perl 6 Regex Tablet: Revision 21
Overview - Chapter: 0:History, 1:Design, 2:Basics, 3:Var, 4:Op, 5:IO, 6:{}, 7:Sub, 8:OOP, 9:Rx, 10:Meta Larry Wall: We put the "Regular" back into "Expression". Like quotes, are Regular Expressions now a sublanguage, a language inside the language, instead of being just funny strings. They are parsed by a completely different set of rules, which are stored in the special variable $~Regex ($~Trans for transliterations and $~P5Regex for compatible Regexes). But these rules are made much more consistant with the main language than before. Literal CharacterEvery alphanumeric character has no special meaning and stand for the character visible. If a backslash (\) is standing directly in front of the character it becomes a metacharacter. For not alphanumeric chars the opposite is true. Inside of quotes every char is literal. MetacharacterModifierOperatorsrx/.../ aka Q :regex /.../ Methodscomb Special Variables$/ MatchingSubstitutionTransliterationmy $escaped = $html.trans([ '&', '<', '>' ] =>); GrammarsPredefined RulesAre listed here. <prior> is somehow an exception.
Overview - Chapter: 0:History, 1:Design, 2:Basics, 3:Var, 4:Op, 5:IO, 6:{}, 7:Sub, 8:OOP, 9:Rx, 10:Meta |