spec/regexp-examples_spec.rb in regexp-examples-0.0.2 vs spec/regexp-examples_spec.rb in regexp-examples-0.1.0
- old
+ new
@@ -50,9 +50,24 @@
/[\-]/,
/[%-+]/ # This regex is "supposed to" match some surprising things!!!
)
end
+ context "for complex multi groups" do
+ examples_exist_and_match(
+ /(normal)/,
+ /(?:nocapture)/,
+ /(?<name>namedgroup)/,
+ /(?<name>namedgroup) \k<name>/
+ )
+ # TODO: These are not yet implemented
+ # (expect to raise exception)
+# /(?=lookahead)/,
+# /(?!neglookahead)/,
+# /(?<=lookbehind)/,
+# /(?<!neglookbehind)/,
+ end
+
context "for escaped characters" do
examples_exist_and_match(
/\w/,
/\s/,
/\d/,