Regular expressions: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
Line 2,993:
{{libheader|Wren-pattern}}
The above module allows us to do simple string pattern matching and replacement in a similar fashion to regular expressions but using a different syntax. SenseTalk's examples have been borrowed for this purpose.
<syntaxhighlight lang="ecmascriptwren">import "./pattern" for Pattern
 
var s = "This is a story about R2D2 and C3P0 who are best friends."
Line 3,040:
{{libheader|Wren-regex}}
The above module uses RE2 regular expression syntax but, since it is a wrapper for Go's 'regexp' package, it can only be used from a special embedded application and not by Wren-cli.
<syntaxhighlight lang="ecmascriptwren">/* regular_expressionsRegular_expressions_2.wren */
import "./regex" for Regex
 
9,479

edits