You are here: Re: Regexp - matching text not containing certain count of certain characters « PHP Programming Language « IT news, forums, messages
Re: Regexp - matching text not containing certain count of certain characters

Posted by Jiri Fogl on 11/19/49 11:45

John Dunlop wrote:
> 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
>

Thank you for this link very much. I didn't know about this RFC, this is
definitely what I've been searching for (even I didn't know that :-) ).

Thanks again.

 

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

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