comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » URL Parsing for wget in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
URL Parsing for wget in IDL [message #54849] Tue, 17 July 2007 08:54 Go to next message
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
Hi Folks,

Does anyone know of a handy way of parsing URLs in IDL? Or even a
nice perl script to do it? The situation is that we have a server that
can accept SQL queries via URL encoding of a get command, which works in
the main part but falls over with '&' and '+' type syntax.

I'll write a regexp version myself if necessary, but it's not trivial
- you have to ensure the ordering is correct as there are several
encodings which use characters which would other wise be replaced.

cheers,

Ben

--
Ben Panter, Edinburgh, UK.
Email false, http://www.benpanter.co.uk
or you could try ben at ^^^^^^^^^^^^^^^
Re: URL Parsing for wget in IDL [message #54898 is a reply to message #54849] Thu, 19 July 2007 08:45 Go to previous message
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
Michael Galloy wrote:

> The regular expression they suggest is:
>
> ^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^# ?\s]+)(.*)?(#[\w\-]+)$
>
>
> which I think will be OK for IDL except \s (whitesace) needs to be
> [[:blank:]] and \w (word character) needs to be [[:alnum:]_]
>
> Check out:
>
> http://michaelgalloy.com/2006/06/11/regular-expressions.html
>
> which links to a paper with more details at:
>
> http://www.ittvis.com/codebank/search.asp?FID=311
>

Thanks guys - will do.

Ben

--
Ben Panter, Edinburgh, UK.
Email false, http://www.benpanter.co.uk
or you could try ben at ^^^^^^^^^^^^^^^
Re: URL Parsing for wget in IDL [message #54899 is a reply to message #54849] Thu, 19 July 2007 08:19 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Conor wrote:
> On Jul 17, 11:54 am, Ben Panter <m...@privacy.net> wrote:
>> Hi Folks,
>>
>> Does anyone know of a handy way of parsing URLs in IDL? Or even a
>> nice perl script to do it? The situation is that we have a server that
>> can accept SQL queries via URL encoding of a get command, which works in
>> the main part but falls over with '&' and '+' type syntax.
>>
>> I'll write a regexp version myself if necessary, but it's not trivial
>> - you have to ensure the ordering is correct as there are several
>> encodings which use characters which would other wise be replaced.
>>
>> cheers,
>>
>> Ben
>>
>> --
>> Ben Panter, Edinburgh, UK.
>> Email false,http://www.benpanter.co.uk
>> or you could try ben at ^^^^^^^^^^^^^^^
>
> Googling "perl parse url" brought up plenty of promising looking
> candidates. Here's one:
>
> http://textsnippets.com/posts/show/523
>
> IDL does have regular expressions, although I haven't tried to see if
> they can do as much as perl (they probably can). So you can always
> take one of those regular expressions and just convert it to an IDL
> regular expression. IDL does use different syntax than perl, so it
> would take some work. You would also have to know a lot about the IDL
> regular expression system, which I'm afraid I can't help you with.
> There's a website somewhere that explains it all, but I can't find it
> at the moment. Someone here knows though...
>

The regular expression they suggest is:

^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^# ?\s]+)(.*)?(#[\w\-]+)$

which I think will be OK for IDL except \s (whitesace) needs to be
[[:blank:]] and \w (word character) needs to be [[:alnum:]_]

Check out:

http://michaelgalloy.com/2006/06/11/regular-expressions.html

which links to a paper with more details at:

http://www.ittvis.com/codebank/search.asp?FID=311

Mike
--
www.michaelgalloy.com
Re: URL Parsing for wget in IDL [message #54916 is a reply to message #54849] Wed, 18 July 2007 12:11 Go to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Jul 17, 11:54 am, Ben Panter <m...@privacy.net> wrote:
> Hi Folks,
>
> Does anyone know of a handy way of parsing URLs in IDL? Or even a
> nice perl script to do it? The situation is that we have a server that
> can accept SQL queries via URL encoding of a get command, which works in
> the main part but falls over with '&' and '+' type syntax.
>
> I'll write a regexp version myself if necessary, but it's not trivial
> - you have to ensure the ordering is correct as there are several
> encodings which use characters which would other wise be replaced.
>
> cheers,
>
> Ben
>
> --
> Ben Panter, Edinburgh, UK.
> Email false,http://www.benpanter.co.uk
> or you could try ben at ^^^^^^^^^^^^^^^

Googling "perl parse url" brought up plenty of promising looking
candidates. Here's one:

http://textsnippets.com/posts/show/523

IDL does have regular expressions, although I haven't tried to see if
they can do as much as perl (they probably can). So you can always
take one of those regular expressions and just convert it to an IDL
regular expression. IDL does use different syntax than perl, so it
would take some work. You would also have to know a lot about the IDL
regular expression system, which I'm afraid I can't help you with.
There's a website somewhere that explains it all, but I can't find it
at the moment. Someone here knows though...
Re: URL Parsing for wget in IDL [message #54918 is a reply to message #54849] Wed, 18 July 2007 11:48 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jul 17, 9:54 am, Ben Panter <m...@privacy.net> wrote:
> Hi Folks,
>
> Does anyone know of a handy way of parsing URLs in IDL? Or even a
> nice perl script to do it? The situation is that we have a server that
> can accept SQL queries via URL encoding of a get command, which works in
> the main part but falls over with '&' and '+' type syntax.
>
> I'll write a regexp version myself if necessary, but it's not trivial
> - you have to ensure the ordering is correct as there are several
> encodings which use characters which would other wise be replaced.

There is a PARSE_URL routine in IDL 6.4 that would probably get you
started.

Mike
--
www.michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Windows IDL in Parallels on a MacBook
Next Topic: Re: warp_tri()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:08:45 PDT 2025

Total time taken to generate the page: 1.68173 seconds