Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Commit

Permalink
Add more Regexp, MatchData, and String APIs
Browse files Browse the repository at this point in the history
This commit is in support of GH-85.

Add the following APIs:

- Regexp::escape
- Regexp::union
- Regexp#===
- Regexp#names
- Regexp#named_captures
- Regexp#options
- MatchData#length
- MatchData#named_captures
- String#scan
- String#-@

Added the constants Regexp::IGNORECASE, Regexp::EXTENDED, and
Regexp::MULTILINE.

Regexp#to_s and Regexp#inspect were erroneously implemented with the
same function. Regexp#to_s now supports roundtripping through
Regexp::compile.

Imported escape functionality from Rust regex crate.

Fix null pointer exception in String#=~ when Regexp does not match.

Reimplemented the following String APIs to work with Regexp patterns:

- String#split (TODO: does not handle blocks)
- String#sub
- String#gsub
- String#gsub!
  • Loading branch information
lopopolo committed Jun 14, 2019
1 parent 3da4b8d commit 6aae738
Show file tree
Hide file tree
Showing 6 changed files with 608 additions and 12 deletions.

0 comments on commit 6aae738

Please sign in to comment.