hi all!
i'm looking at using the ci function 'pmatch' in a script...and thought
i would run some little tests before committing to using it.
here's the help text for pmatch:
Syntax: PMATCH(pattern,str[,start])
Defn: A CI evaluator function that searches for pattern
in a string beginning at start. Default start is 1.
Type: Boolean
Example: pmatch('f@','fread')
Result: TRUE
Example: pmatch('abc','abcd')
Result: FALSE
so starting with:
setvar x 'fread'
pmatch will indeed return true if you search for [log in to unmask] if x is
modified to:
setvar x 'fread silly'
pmatch will still (as expected) to return true when searching for [log in to unmask]
however if you search for 's@', pmatch returns false! given the help
text, i would fully expect pmatch to return true in this situation.
further experimentation shows that pmatch only works (returns true) if
the search pattern is set to look for what's at the beginning of the
string -- which strikes me as rather pointless.
the implied advantage of pmatch is that it will search for a pattern
(hence '@' (and obtw, are any of the other mpe wildcard symbols
supported (theoretically))) -- where str and pos only deal with
literals.
so -- is pmatch broke? - d
Donna Garverick, HP-CSA Sr. System Programmer
dgarverick -at- longs -dot- com
925-210-6631 Longs Drug Stores
Come, my friends, 'Tis not too late to seek a newer world.
Tho' much is taken, much abides; and tho'
We are not now that strength which in old days
Moved earth and heaven, that which we are, we are.
"Ulysses", A. Tennyson
>>>MY opinions, not Longs Drug Stores'<<<
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|