Posted by Alexey Kulentsov on 05/29/07 23:32
e_matthes@hotmail.com wrote:
> $acceptableTextRegExp = "/^[a-zA-Z0-9_\- ]\{$minLengthIn,
> $maxLengthIn}/";
.....
> If I take out the \ before the open brace, both systems give me an
> error about unmatched braces. Are escape characters handled
PHP try to parse this: {$minLengthIn,$maxLengthIn} as one expression. {}
used in PHP string as special symbols. You can use '-string to avoid
such things:
$acceptableTextRegExp = '/^[a-zA-Z0-9_\-
]{'.$minLengthIn.'.'.$maxLengthIn.'}/';
Navigation:
[Reply to this message]
|