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]
|