Article View: borland.public.csharpbuilder.language.csharp
Article #221Regular Expression for URI
From: Peter Jones
Date: Thu, 13 Jul 2006 03:06
Date: Thu, 13 Jul 2006 03:06
19 lines
1432 bytes
1432 bytes
Hi,
I googled the regular expression for checking webservice URI, and
got the following result. But when I tried it, it seems like not
working as expected.
//*************************
string InvalidURI = "InvalidURI";
string RegexURI = "(([a-zA-Z][0-9a-zA-Z+\\-\\.]*:)?/{0,2}[0-9a-zA-Z;/?:@&=+$\\.\\-_!~*'()%]+)?(#[0-9a-zA-Z;/?:@&=+$\\.\\-_!~*'()%]+)?";
return Regex.IsMatch(InvalidURI, RegexURI); //return true, but false expected)
//*************************
Does anyone have an idea on what regular expression should be
used for URI?
Thanks,
Peter
I googled it and found the following expression. But when I tried to check, it seems like not working
But when I tried:
Technical Details
Message-ID:
<44b5b8bf$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,b06982d6c448cfda,start X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Peter Jones" <peter@hotmail.com> Sender: "Peter Jones" <peter@hotmail.com> Reply-To: "Peter Jones" <peter@hotmail.com> Subject: Regular Expression for URI Newsgroups: borland.public.csharpbuilder.language.csharp X-User-Info: 70.30.13.85 NNTP-Posting-Host: 207.105.83.66 Message-ID: <44b5b8bf$1@newsgroups.borland.com> Date: 12 Jul 2006 20:06:39 -0700 X-Trace: newsgroups.borland.com 1152759999 207.105.83.66 (12 Jul 2006 20:06:39 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail