summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-07-03 14:34:05 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-07-03 14:34:05 +0000
commit9386a2fca276b67a7564b8ca2549fe1f32edc5e9 (patch)
tree2cf09e89daa4fd0823b3be96901879e98d518c2e
parentead4c2def6106b143846c6de0179fa3e6af2845f (diff)
downloadperl-9386a2fca276b67a7564b8ca2549fe1f32edc5e9.tar.gz
More tests for \g errors in regular expressions
p4raw-id: //depot/perl@31525
-rw-r--r--t/op/re_tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/op/re_tests b/t/op/re_tests
index f4dca6e1fc..55b43001db 100644
--- a/t/op/re_tests
+++ b/t/op/re_tests
@@ -253,6 +253,14 @@ a[-]?c ac y $& ac
([a-c]*)\1 abcabc y $1 abc
\1 - c - Reference to nonexistent group
\2 - c - Reference to nonexistent group
+\g1 - c - Reference to nonexistent group
+\g-1 - c - Reference to nonexistent or unclosed group
+\g{1} - c - Reference to nonexistent group
+\g{-1} - c - Reference to nonexistent or unclosed group
+\g0 - c - Reference to invalid group 0
+\g-0 - c - Reference to invalid group 0
+\g{0} - c - Reference to invalid group 0
+\g{-0} - c - Reference to invalid group 0
(a)|\1 a y - -
(a)|\1 x n - -
(a)|\2 - c - Reference to nonexistent group