-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backreferences for NAMED capture groups (v0.1.0)
e.g. /(?<name>foo) \k<name>/.examples Bumped the version to 0.1.0 as this is a big feature update!
- Loading branch information
Showing
7 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
class Regexp | ||
module Examples | ||
def examples | ||
partial_examples = | ||
RegexpExamples::Parser.new(source) | ||
.parse | ||
.map {|repeater| repeater.result} | ||
full_examples = RegexpExamples::permutations_of_strings(partial_examples.dup, no_join: true) | ||
full_examples_with_backrefs = \ | ||
RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples) | ||
full_examples_with_backrefs.map(&:join) | ||
module Examples | ||
def examples | ||
partial_examples = | ||
RegexpExamples::Parser.new(source) | ||
.parse | ||
.map {|repeater| repeater.result} | ||
full_examples = RegexpExamples::permutations_of_strings(partial_examples.dup, no_join: true) | ||
full_examples_with_backrefs = \ | ||
RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples) | ||
full_examples_with_backrefs.map(&:join) | ||
end | ||
end | ||
end | ||
include Examples | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module RegexpExamples | ||
VERSION = '0.0.2' | ||
VERSION = '0.1.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters