Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing strings
Message
From
18/11/2006 02:59:13
 
 
To
17/11/2006 14:13:35
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01170633
Message ID:
01170927
Views:
9
>Hi Gregory,
>
>only character 1-4 was in the description. What ever follows follows. ::)

Yes, my mistake. I should have read the whole message
>
>But yes you are right. At least as long loRegExp.MULTLINE is off. <g>
>
>
>BTW. I found some tome to read your link. So understand that building the machine might slow down for complex patterns. This will change the design of the use somehow. Thanks again.

The reason I mentioned the links, was to get a better understanding how the machine works. It's a state machine. The active states are marked with a penny

As to building the machine, this example is perl related. The way we use it, it's only built each time you assign a pattern (and maybe the IgnoreCase as well ?)

But there are times I have a couple of RegEx'es active, each with a different pattern


>
>Agnes
>>hi Agnes,
>>
>>One small correction
>>
>>
>>loRegExp.PATTERN = '^PM\d\d$'  && without the $ it will match PM123
>>
>>
>>>Hi Matthew,
>>>
>>>it will not work with a signle VFP command. You have only like() and this works DOS like with *? wildcards
>>>
>>>You may do something like
>>>
>>>if !(worktype='PM' and isdigit(substr(worktype,3,1)) and isdigit(substr(worktype,4,1))) then
>>>endif
>>>
>>>
>>>there is a more clever solution with regexp.
>>>
>>>loRegExp = CREATEOBJECT('VBScript.RegExp')
>>>loRegExp.PATTERN = '^PM\d\d'
>>>
>>>if !loRegExp.TEST(workplace) then
>>>...
>>>endif
>>>
>>>
>>>Agnes
>>>>Hi there,
>>>>
>>>>I'm having problems figuring out wildcards for string comparisons.
>>>>
>>>>I have a WorkType variable that is a string. It always starts with PM and then a 2 digit number. So I want to have an if statement checking it's valid. i've used this code and it doesn't work:
>>>>
>>>>If WorkType != "PM##"
>>>> lcErrorMessage = lcErrorMessage + "Work type is invalid..."
>>>>Endif
>>>>
>>>>So when valid WorkType come in (e.g. PM03, PM14) they are failing.
>>>>
>>>>Any help would be much appreciated
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform