Reply to Re: what does a dot "." mean in regex, when it is in brackets?

Your name:

Reply:


Posted by billy on 11/03/05 21:07

| ^content/([^/]+)/([^.]+)$
|
| I know the "^" means "not".

that is incorrect...it only means "not" within a character class (characters
within braces). it also means the *beggining of the string* should match the
pattern that follows.

the above means the entire string should match the pattern because of the ^
at the beggining of the pattern and the $ at the end (which means string
should *end with the preceeding pattern*).

so...

the string should begin with the characters "content/" followed by a group
of one or more characters that are not "/" but are all followed by one "/"
followed a group of one or more characters where no single character is
followed immediately by itself.

[^.]+ means that "aba" is fine but "aab" is not since one "a" immediately
follows another (adjacent).

hth,

me

[Back to original 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

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