>>Sergey,
>>
>>Again, great for noticing. I understood this bug at home too, but your message was a reminder to me to fix it. I'll do it right now.
>>
>>Thanks again for your help. I noticed, you often use this technique, and I'll start too. I also will investigate "Ed's route"...
>>
>Out of general boredom:
>
>
oRegExp=CREATEOBJ('vbscript.regexp')
>oRegExp.Pattern = '\d{6}[A-Z]-[A-Z]\d{6}[A-Z]-[A-Z]\d{6}[A-Z]{2}-[A-Z]{2}\d{6}[A-Z]'
>? oRegExp.Test('012345A-B012345C-D012345EF-GH012345I')
>? oRegExp.Test('012345A-b012345C-D012345EF-GH012345I')
Oops, grabbed the wrong template, you're using 999999X-X999999X-X999999XX-XX999999X-XXXXXX - the following massize code change is needed:
oRegExp=CREATEOBJ('vbscript.regexp')
oRegExp.Pattern = '^\d{6}[A-Z]-[A-Z]\d{6}[A-Z]-[A-Z]\d{6}[A-Z]{2}-[A-Z]{2}\d{6}[A-Z]-[A-Z]{6}$'
You can be far more selective; for example, lets try an ISBN, 10 characters long, the first 9 are digits, but the last position could be 0-9 or "X"
oRegExp.Pattern = "\d{9}[0-9X]"
or how about 3 numbers of 1-4 digits in length, followed by a comma which might be followed with a space or might not:
oRegExp.Pattern = "\d{1,4},\s?\d{1,4},\s?\d{1,4}"
Let's change that to allow any number of blanks instead of 0 or 1:
oRegExp.Pattern = "\d{1,4},\s*\d{1,4},\s*\d{1,4}"
3 words at the start of a line, any case, composed of letters, with any amount of whitespace in between, and the end of the third word ending the string:
oRegExp.Pattern = '^[A-Za-z]+\s+[A-Za-z]+\s+[A-Za-z]+$'
Try this with "The quick brown", "The quick brown fox", " The quick brown" and "The quick brown"
A vowel, followed by 3-9 valid VFP 'name' characters:
oRegExp.Pattern = "^[AEIOU]\w{3,9}$"