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