Opening the book…
Regular expressions are an essential tool for manipulating strings in a trivial way. This chapter presented the Regex package for Pharo. The essential points of this chapter are:
- For simple matching, just send
matchesRegex:to a string - When performance matters, send
asRegexto the string representing the regex, and reuse the resulting matcher for multiple matches - Subexpression of a matching regex may be easily retrieved to an arbitrary depth
- A matching regex can also replace or translate subexpressions in a new copy of the string matched
- An enumeration interface is provided to access all matches of a certain regular expression
- Regexes work with streams as well as with strings.
This page titled 17.6: Chapter Summary was last modified on Sat, 19 Dec 2020 08:13:35 GMT and is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by via source content that was edited to the style and standards of the LibreTexts platform.
The book could not be loaded just now.