Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hierarchical SQL Select
Message
From
07/09/2009 23:21:24
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01422513
Message ID:
01423017
Views:
39
>>>>(1) Where do you see it allows space chars
>>>>
>>>
>>>Gregory,
>>>
>>>I just tested them with the little program in VFP.
>>So, did I - don't see it
>>
>>What part of the regex do you think allows a space char ?
>
>Is my test program wrong?
>
>
>CLEAR ALL
>
>lcPattern = '(((http[s]?|ftp)://)|(www\.))[\w/.()-]+[\w/.(-]'
>
>local obj
>	obj = createobject('VBScript.RegExp')
>	obj.Global = .F.
>	obj.IgnoreCase = .T.
>	obj.Pattern = m.lcPattern &&'\bking\b'
>	
>	?obj.Test('http://msdn.microsoft.com/en-us/library/aa172799SQL.80.aspx')  
>* extra space at the end
>	?obj.Test('www.msdn.microsoft.com/en-us/library/aa139615.aspx ') 
>	
>	?obj.Test('http://msdn.microsoft.com/en-us/library/aa172799(SQL.80).aspx')  
>	?obj.Test('http://msdn.microsoft.com/en-us/library/aa172799SQL.80.a') 
>
>* Here - a space in the middle
>	?obj.Test('http://msdn.microsoft.com/en-us/library/ aa172799SQL.80.a') 
>	?obj.Test('www.test')
>
>BTW, starting your day early today?

Look at the matches collection - not at test(). If you want to look at test(), use
^((((http[s]?|ftp)://)|(www\.))[\w/.()-]+[\w/.(-])$
In the last example it only matches
http://msdn.microsoft.com/en-us/library/
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform