Reply to Re: Regexp - matching text not containing certain count of certain characters

Your name:

Reply:


Posted by John Dunlop on 04/11/06 21:16

Jiri Fogl:

> Regular expression I need has to search through path or URL and find
> every reference to a parent directory, including this parent directory.
>
> For example if I have URL like this:
> http://www.example.com/mydir/../myotherdir
> RE is supposed to match /mydir/../ so I can replace it by a single slash
> and get "definite" URL.

Sorry, I don't know how you'd do that with a regular expression, even
with a PCRE.

Does it need to be done with a single RE? If not, RFC3986 gives an
example algorithm for removing dot segments (sec. 5.2.4), and the whole
algorithm of section 5.2 is definitive, so I would refer to it anyway.

http://www.ietf.org/rfc/rfc3986.txt

--
Jock

[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

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