You are here: Re: Windows/ Unix regular expression question « PHP Programming Language « IT news, forums, messages
Re: Windows/ Unix regular expression question

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация