From: Kenneth A. Larsen on

"Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
news:Oyc935wMLHA.5668(a)TK2MSFTNGP04.phx.gbl...
>
> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
> news:eMx%23jGXMLHA.3668(a)TK2MSFTNGP04.phx.gbl...
>>
>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>> news:%23NUeGTQMLHA.2100(a)TK2MSFTNGP06.phx.gbl...
>>>
>>> "Mayayana" <mayayana(a)invalid.nospam> wrote in message
>>> news:i316um$p7g$1(a)news.eternal-september.org...
>>>>I don't use RegExp, but in case you don't
>>>> find an answer you can also use a simple
>>>> function:
>>>>
>>>> Function IsValid(s1)
>>>> Dim i2, Asc1
>>>> IsValid = False
>>>> If Len(s1) > 32 Then Exit Function
>>>> If Len(s1) = 0 Then IsValid = True: Exit Function
>>>> For i2 = 1 to Len(s1)
>>>> Asc1 = Asc(mid(s1, i2, 1))
>>>> Select Case Asc1
>>>> Case 44, 45, 95
>>>> '--
>>>> Case Else
>>>> If ((Asc1 > 64) And (Asc1 < 91)) Or ((Asc1 > 96) And (Asc1 <
>>>> 123)) Or ((Asc1 > 47) And (Asc1 < 58)) Then
>>>> '--
>>>> Else
>>>> Exit Function
>>>> End If
>>>> End Select
>>>> Next
>>>> IsValid = True
>>>> End Function
>>>>
>>>> |
>>>> | I use this function:
>>>> |
>>>> | Function ValidateField(strInput, txtRegExp)
>>>> | Set re = new regexp
>>>> | re.Pattern = txtRegExp
>>>> | re.IgnoreCase=true
>>>> | ValidateField=re.Test(strInput)
>>>> | set re = Nothing
>>>> | End Function
>>>> |
>>>> | to validate text field values against regular expressions. I'm no
>>>> wizard
>>>> | when it comes to regexps. I got 99% of the text fields covered,
>>>> except for
>>>> | this one:
>>>> |
>>>> | The text field:
>>>> |
>>>> | * can be empty
>>>> | * can be a single alphanumeric string with up to 32 characters
>>>> | * must not contain any spaces or any non-alphanumeric characters
>>>> except
>>>> | underscore, dash and comma
>>>> | * can be a comma separated list of up to 10 strings as defined above,
>>>> e.g
>>>> .
>>>> | "entry1,entry2,veryveryverylongentry3"
>>>> |
>>>> |
>>>> | Can this be done by a regular expression?
>>>> |
>>>> | Tom
>>>> |
>>>> |
>>>>
>>>>
>>>
>>>
>>
>>
>
>


From: Kenneth A. Larsen on

"Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
news:uLiHn%23wMLHA.5624(a)TK2MSFTNGP02.phx.gbl...
>
> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
> news:Oyc935wMLHA.5668(a)TK2MSFTNGP04.phx.gbl...
>>
>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>> news:eMx%23jGXMLHA.3668(a)TK2MSFTNGP04.phx.gbl...
>>>
>>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>>> news:%23NUeGTQMLHA.2100(a)TK2MSFTNGP06.phx.gbl...
>>>>
>>>> "Mayayana" <mayayana(a)invalid.nospam> wrote in message
>>>> news:i316um$p7g$1(a)news.eternal-september.org...
>>>>>I don't use RegExp, but in case you don't
>>>>> find an answer you can also use a simple
>>>>> function:
>>>>>
>>>>> Function IsValid(s1)
>>>>> Dim i2, Asc1
>>>>> IsValid = False
>>>>> If Len(s1) > 32 Then Exit Function
>>>>> If Len(s1) = 0 Then IsValid = True: Exit Function
>>>>> For i2 = 1 to Len(s1)
>>>>> Asc1 = Asc(mid(s1, i2, 1))
>>>>> Select Case Asc1
>>>>> Case 44, 45, 95
>>>>> '--
>>>>> Case Else
>>>>> If ((Asc1 > 64) And (Asc1 < 91)) Or ((Asc1 > 96) And (Asc1 <
>>>>> 123)) Or ((Asc1 > 47) And (Asc1 < 58)) Then
>>>>> '--
>>>>> Else
>>>>> Exit Function
>>>>> End If
>>>>> End Select
>>>>> Next
>>>>> IsValid = True
>>>>> End Function
>>>>>
>>>>> |
>>>>> | I use this function:
>>>>> |
>>>>> | Function ValidateField(strInput, txtRegExp)
>>>>> | Set re = new regexp
>>>>> | re.Pattern = txtRegExp
>>>>> | re.IgnoreCase=true
>>>>> | ValidateField=re.Test(strInput)
>>>>> | set re = Nothing
>>>>> | End Function
>>>>> |
>>>>> | to validate text field values against regular expressions. I'm no
>>>>> wizard
>>>>> | when it comes to regexps. I got 99% of the text fields covered,
>>>>> except for
>>>>> | this one:
>>>>> |
>>>>> | The text field:
>>>>> |
>>>>> | * can be empty
>>>>> | * can be a single alphanumeric string with up to 32 characters
>>>>> | * must not contain any spaces or any non-alphanumeric characters
>>>>> except
>>>>> | underscore, dash and comma
>>>>> | * can be a comma separated list of up to 10 strings as defined
>>>>> above, e.g
>>>>> .
>>>>> | "entry1,entry2,veryveryverylongentry3"
>>>>> |
>>>>> |
>>>>> | Can this be done by a regular expression?
>>>>> |
>>>>> | Tom
>>>>> |
>>>>> |
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


From: Kenneth A. Larsen on

"Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
news:u%23NSYbCNLHA.4968(a)TK2MSFTNGP02.phx.gbl...
>
> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
> news:uLiHn%23wMLHA.5624(a)TK2MSFTNGP02.phx.gbl...
>>
>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>> news:Oyc935wMLHA.5668(a)TK2MSFTNGP04.phx.gbl...
>>>
>>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>>> news:eMx%23jGXMLHA.3668(a)TK2MSFTNGP04.phx.gbl...
>>>>
>>>> "Kenneth A. Larsen" <kuhlpc#2(a)optimum.net> wrote in message
>>>> news:%23NUeGTQMLHA.2100(a)TK2MSFTNGP06.phx.gbl...
>>>>>
>>>>> "Mayayana" <mayayana(a)invalid.nospam> wrote in message
>>>>> news:i316um$p7g$1(a)news.eternal-september.org...
>>>>>>I don't use RegExp, but in case you don't
>>>>>> find an answer you can also use a simple
>>>>>> function:
>>>>>>
>>>>>> Function IsValid(s1)
>>>>>> Dim i2, Asc1
>>>>>> IsValid = False
>>>>>> If Len(s1) > 32 Then Exit Function
>>>>>> If Len(s1) = 0 Then IsValid = True: Exit Function
>>>>>> For i2 = 1 to Len(s1)
>>>>>> Asc1 = Asc(mid(s1, i2, 1))
>>>>>> Select Case Asc1
>>>>>> Case 44, 45, 95
>>>>>> '--
>>>>>> Case Else
>>>>>> If ((Asc1 > 64) And (Asc1 < 91)) Or ((Asc1 > 96) And (Asc1
>>>>>> <
>>>>>> 123)) Or ((Asc1 > 47) And (Asc1 < 58)) Then
>>>>>> '--
>>>>>> Else
>>>>>> Exit Function
>>>>>> End If
>>>>>> End Select
>>>>>> Next
>>>>>> IsValid = True
>>>>>> End Function
>>>>>>
>>>>>> |
>>>>>> | I use this function:
>>>>>> |
>>>>>> | Function ValidateField(strInput, txtRegExp)
>>>>>> | Set re = new regexp
>>>>>> | re.Pattern = txtRegExp
>>>>>> | re.IgnoreCase=true
>>>>>> | ValidateField=re.Test(strInput)
>>>>>> | set re = Nothing
>>>>>> | End Function
>>>>>> |
>>>>>> | to validate text field values against regular expressions. I'm no
>>>>>> wizard
>>>>>> | when it comes to regexps. I got 99% of the text fields covered,
>>>>>> except for
>>>>>> | this one:
>>>>>> |
>>>>>> | The text field:
>>>>>> |
>>>>>> | * can be empty
>>>>>> | * can be a single alphanumeric string with up to 32 characters
>>>>>> | * must not contain any spaces or any non-alphanumeric characters
>>>>>> except
>>>>>> | underscore, dash and comma
>>>>>> | * can be a comma separated list of up to 10 strings as defined
>>>>>> above, e.g
>>>>>> .
>>>>>> | "entry1,entry2,veryveryverylongentry3"
>>>>>> |
>>>>>> |
>>>>>> | Can this be done by a regular expression?
>>>>>> |
>>>>>> | Tom
>>>>>> |
>>>>>> |
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>