| 242 |
/* 55 */ |
/* 55 */ |
| 243 |
"repeating a DEFINE group is not allowed", |
"repeating a DEFINE group is not allowed", |
| 244 |
"inconsistent NEWLINE options", |
"inconsistent NEWLINE options", |
| 245 |
"\\g is not followed by an (optionally braced) non-zero number", |
"\\g is not followed by a braced name or an optionally braced non-zero number", |
| 246 |
"(?+ or (?- or (?(+ or (?(- must be followed by a non-zero number" |
"(?+ or (?- or (?(+ or (?(- must be followed by a non-zero number" |
| 247 |
}; |
}; |
| 248 |
|
|
| 453 |
|
|
| 454 |
/* \g must be followed by a number, either plain or braced. If positive, it |
/* \g must be followed by a number, either plain or braced. If positive, it |
| 455 |
is an absolute backreference. If negative, it is a relative backreference. |
is an absolute backreference. If negative, it is a relative backreference. |
| 456 |
This is a Perl 5.10 feature. */ |
This is a Perl 5.10 feature. Perl 5.10 also supports \g{name} as a |
| 457 |
|
reference to a named group. This is part of Perl's movement towards a |
| 458 |
|
unified syntax for back references. As this is synonymous with \k{name}, we |
| 459 |
|
fudge it up by pretending it really was \k. */ |
| 460 |
|
|
| 461 |
case 'g': |
case 'g': |
| 462 |
if (ptr[1] == '{') |
if (ptr[1] == '{') |
| 463 |
{ |
{ |
| 464 |
|
const uschar *p; |
| 465 |
|
for (p = ptr+2; *p != 0 && *p != '}'; p++) |
| 466 |
|
if (*p != '-' && (digitab[*p] & ctype_digit) == 0) break; |
| 467 |
|
if (*p != 0 && *p != '}') |
| 468 |
|
{ |
| 469 |
|
c = -ESC_k; |
| 470 |
|
break; |
| 471 |
|
} |
| 472 |
braced = TRUE; |
braced = TRUE; |
| 473 |
ptr++; |
ptr++; |
| 474 |
} |
} |
| 4481 |
zerofirstbyte = firstbyte; |
zerofirstbyte = firstbyte; |
| 4482 |
zeroreqbyte = reqbyte; |
zeroreqbyte = reqbyte; |
| 4483 |
|
|
| 4484 |
/* \k<name> or \k'name' is a back reference by name (Perl syntax) */ |
/* \k<name> or \k'name' is a back reference by name (Perl syntax). |
| 4485 |
|
We also support \k{name} (.NET syntax) */ |
| 4486 |
|
|
| 4487 |
if (-c == ESC_k && (ptr[1] == '<' || ptr[1] == '\'')) |
if (-c == ESC_k && (ptr[1] == '<' || ptr[1] == '\'' || ptr[1] == '{')) |
| 4488 |
{ |
{ |
| 4489 |
is_recurse = FALSE; |
is_recurse = FALSE; |
| 4490 |
terminator = (*(++ptr) == '<')? '>' : '\''; |
terminator = (*(++ptr) == '<')? '>' : (*ptr == '\'')? '\'' : '}'; |
| 4491 |
goto NAMED_REF_OR_RECURSE; |
goto NAMED_REF_OR_RECURSE; |
| 4492 |
} |
} |
| 4493 |
|
|