Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Raku (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Regular expressions=== {{Main|Raku rules}} Perl's [[regular expression]] and string-processing support has always been one of its defining features.<ref>{{cite web | url=http://cslibrary.stanford.edu/108/EssentialPerl.html#re | title=Essential Perl: String Processing with Regular Expressions | author=Parlante, Nick | year=2000}}</ref> Since Perl's pattern-matching constructs have exceeded the capabilities of [[regular language]] expressions for some time,<ref>{{cite web | url=http://www.perl.com/doc/FMTEYEWTK/regexps.html | title=PERL5 Regular Expression Description | author=Christiansen, Tom | year=1996 | quote=Perl's regexps "aren't" -- that is, they aren't "regular" because backreferences per sed and grep are also supported, which renders the language no longer strictly regular | access-date=25 March 2010 | archive-url=https://web.archive.org/web/20100331122815/http://www.perl.com/doc/FMTEYEWTK/regexps.html | archive-date=31 March 2010 | url-status=dead }}</ref> Raku documentation exclusively refers to them as ''regexes'', distancing the term from the formal definition. Raku provides a superset of Perl features with respect to regexes, folding them into a larger framework called "[[Raku rules|rules]]" which provide the capabilities of [[Context-sensitive language|context-sensitive]] [[parsing]] formalisms (such as the [[syntactic predicate]]s of [[parsing expression grammar]]s and [[ANTLR]]), as well as acting as a [[Closure (computer science)|closure]] with respect to their [[Scope (programming)|lexical scope]].<ref>{{cite web | url=https://design.raku.org/S05.html | title=Synopsis 5: Regexes and Rules | author=Wall, Larry | date=2009-05-20 }}</ref> Rules are introduced with the <code>rule</code> keyword which has a usage quite similar to subroutine definition. Anonymous rules can also be introduced with the <code>regex</code> (or <code>rx</code>) keyword, or they can simply be used inline as regexps were in Perl via the <code>m</code> (matching) or <code>s</code> (substitute) operators. In ''Apocalypse 5'', Larry Wall enumerated 20 problems with "current regex culture". Among these were that Perl's regexes were "too compact and 'cute'", had "too much reliance on too few metacharacters", "little support for named captures", "little support for grammars", and "poor integration with 'real' language".<ref>{{cite web | url=https://raku.org/archive/doc/design/apo/A05.html | title=Apocalypse 5: Pattern Matching | author=Wall, Larry | date=2002-06-04 }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)