You are here: Re: what does a dot "." mean in regex, when it is in brackets? « All PHP « IT news, forums, messages
Re: what does a dot "." mean in regex, when it is in brackets?

Posted by Stefan Rybacki on 11/03/05 18:53

Steve wrote:
>>^content/([^/]+)/([^.]+)$
>
>
>>I know the "^" means "not".
>>Doesn't this:
>>[^.]+
>>mean "not anything"????
>
>
> In fact . in a regexp means any character except a newline (\n). Are
> there any other switches involved that might modify the default
> line-oriented behaviour?

In fact . in [ ] means . itself! so the regular expression above matches

content/ followed by any character but / then a / and then any character but .

Regards
Stefan

>
> ---
> Steve
>

 

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

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