Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 690 Bytes

README.md

File metadata and controls

28 lines (23 loc) · 690 Bytes

Regex

The Regex addon adds support for Perl regular expressions using the PCRE library by Philip Hazel.

Example 1

Io> re := "is.*a" asRegex
Io> "This is a test. This is also a test." \
    matchesOfRegex(" is[^.]*a") replaceAllWith(" is not a")
==> "This is not a test. This is not a test.

Example 2

Io> "11aabb" matchesOfRegex("aa*")
==> list("a", "a")

Io> re := "(wom)(bat)" asRegex
Io> "wombats are cuddly" matchesOfRegex(re) replaceAllWith("$2$1!")
==> batwom!s are cuddly

Installation

pcre should be installed and foundable in your system. Then:

eerie install https://github.com/IoLanguage/Regex.git