diff -pudr src/generic/regcomp.c laconfix/generic/regcomp.c
--- src/generic/regcomp.c	2015-10-27 14:39:17.630481556 -0400
+++ laconfix/generic/regcomp.c	2015-11-07 13:18:25.249459402 -0500
@@ -973,7 +973,7 @@ parseqatom(
 	EMPTYARC(lp, s);
 	EMPTYARC(s2, rp);
 	NOERR();
-	atom = parse(v, ')', PLAIN, s, s2);
+	atom = parse(v, ')', type, s, s2);
 	assert(SEE(')') || ISERR());
 	NEXT();
 	NOERR();
diff -pudr src/tests/reg.test laconfix/tests/reg.test
--- src/tests/reg.test	2015-10-27 14:39:17.808485880 -0400
+++ laconfix/tests/reg.test	2015-11-07 13:20:08.732885019 -0500
@@ -419,6 +419,8 @@ expectNomatch	6.17 I		{x$y}	xy
 expectMatch	6.18 n		"x\$\n"	"x\n"	"x\n"
 expectError	6.19 -		+	BADRPT
 expectError	6.20 -		?	BADRPT
+expectError	6.21 -		{x(\w)(?=(\1))}	ESUBREG
+expectMatch	6.22 HP		{x(?=((foo)))}	xfoo	x
 
 
 doing 7 "simple quantifiers"
