Abstract
When you use a regex to validate input, it is enough to know whether a given string matches the regex or not. In many other cases, we want to extract more data from the string and the regex match.
This is a preview of subscription content, access via your institution.
Buying options
Notes
- 1.
- 2.
- 3.
Early versions of Perl 6 created an array capture for all quantified captures, even with the ? quantifier. It confused most users.
- 4.
This primality test is commonly attributed to Abigail, a prolific Perl hacker. See for example http://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-prime-numbers/ .
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Moritz Lenz
About this chapter
Cite this chapter
Lenz, M. (2017). Extracting Data from Regex Matches. In: Parsing with Perl 6 Regexes and Grammars. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3228-6_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3228-6_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3227-9
Online ISBN: 978-1-4842-3228-6
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books