Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
URL validation
Message
From
27/01/2016 15:56:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01630233
Message ID:
01630307
Views:
71
Looks to me like the lcMail var check, and it isn't there.

Hank

>The pattern doesn't seem correct as I tried all sorts of URLs including
>
>https://social.msdn.microsoft.com
>
>and all returned invalid.
>
>
>I tried a different pattern (from http://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to-check-if-a-string-is-a-valid-url) first answer and it seems to work.
>
>>>Hi everybody,
>>>
>>>I have a textbox which will allow to enter a valid URL (https or http). Do you know what code should I use for validation of the user's input?
>>>
>>>Thanks in advance.
>>
>>
Function ValidUrl
>>Lparameters tcUrl
>>Local lcFilter As String, ;
>>   llReturn As Boolean, ;
>>   loRegex As Object
>>If Pcount() > 0 And Vartype(lcMail) = [C]
>>   Text To m.lcFilter Noshow Pretext 15
>>         ^(http(?:s)?\:\/\/[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*\.[a-zA-Z]{2,6}
>>         (?:\/?|(?:\/[\w\-]+)*)(?:\/?|\/\w+\.[a-zA-Z]{2,4}
>>         (?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$
>>   Endtext
>>   m.loRegex = Createobject([VBScript.RegExp])
>>   m.loRegex.Pattern = m.lcFilter
>>   m.loRegex.IgnoreCase = .T.
>>   m.loRegex.Global = .F.
>>   m.llReturn = m.loRegex.Test(m.tcUrl)
>>   m.loRegex = .Null.
>>   Release m.loRegex
>>Endif
>>Return m.llReturn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform