Saturday, March 24, 2012

Trouble validating an intranet url

Hi,
I'm having trouble validating an intranet URL.

I'm using the regular expresssion validator (though any ideas accepted), and
using the standard Internet URL definition, which is..
http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?

unfortunately this doesn't work with our intranet values, such as (e.g.)

http://homer/wibble/viewDocument.aspx?Data=1789

Does anybody have any ideas?

--
Many thanks.
:)Remove the www part?

http://(/[\w- ./?%&=]*)? -- I didn't try this, I just modified it by
looking at what I thought was correct.

It gives you the http:// part with any number of parts that contain any of
the characters of /[\w- ./?%&=]

If you want to, you could even change this to validate file:/// or ldap://
or whatever tickles your fancy.

There are tons of websites out there with custom regular expressions.

Here is the MSDN language reference:
http://msdn.microsoft.com/library/d...ageElements.asp
--
Staff Consultant II - Enterprise Web Services - Cardinal Solutions Group

Future Business Model - National City Mortgage

"Buggyman" wrote:

> Hi,
> I'm having trouble validating an intranet URL.
> I'm using the regular expresssion validator (though any ideas accepted), and
> using the standard Internet URL definition, which is..
> http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
> unfortunately this doesn't work with our intranet values, such as (e.g.)
> http://homer/wibble/viewDocument.aspx?Data=1789
> Does anybody have any ideas?
> --
> Many thanks.
> :)

0 comments:

Post a Comment