\r\n\r\n
Regular Expressions Topics include: System.Text.RegularExpressions classes, and .NET regular expression syntax.

Go Back  Xtreme .NET Talk > .NET > Regular Expressions > need some help here...


\r\n \r\n \r\n \r\n
 
 
Thread Tools Display Modes
\r\n \r\n
\r\n
\r\n \r\n i have the following pattern (part of a pattern which validates urls..)
\r\ni know its still not perfect but i have a question about it...
\r\n
\r\nthis is the pattern : ("((http)|(https))://(w{3}\\.)(\\w)")
\r\nit valids this : http://www.w
\r\nshould be ok.
\r\nbut when i enter this:
\r\nhttp://www.ww....
\r\nit also ok....hmm...how to fix this that it would be accept the dots..??
\r\nits problem in here (\\w).\r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[427112] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 09-09-2004, 07:56 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n John_0025\r\n John_0025 is offline\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
Quote:
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n Originally Posted by John_0025\r\n \r\n
\r\n
use the "^" and "$" characters.
\r\n
\r\n
\r\n
Code:
\r\n
"^((http)|(https)):\\/\\/(w{3}\\.)(\\w)$"
\r\n
This will match: "http://www.w"
\r\nbut not "http://www.w..." or ".....http://www.w" etc.
\r\n
\r\nGood luck with learning regular expressions.
\r\n \r\n
\r\n
10x!! again....
\r\nim progressing with regex... \r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n'; // next/previous post info pn[427104] = "427119,427112"; pn[0] = ",427104"; pn[427112] = "427104,427119"; pn[427119] = "427112,427104"; // cached usernames pu[0] = guestphrase; pu[36445] = "FlyBoy"; pu[35515] = "John_0025"; // -->
Prev Previous Post   Next Post Next
  #1  
Old 09-09-2004, 06:28 AM
FlyBoy FlyBoy is offline
Centurion
 
Join Date: Sep 2004
Posts: 106
FlyBoy is on a distinguished road
Default need some help here...

i have the following pattern (part of a pattern which validates urls..)
i know its still not perfect but i have a question about it...

this is the pattern : ("((http)|(https))://(w{3}\.)(\w)")
it valids this : http://www.w
should be ok.
but when i enter this:
http://www.ww....
it also ok....hmm...how to fix this that it would be accept the dots..??
its problem in here (\w).
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb