home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
programming
/
arpprog
/
newdocs
/
newpro.arc
/
PatternMatch
< prev
next >
Wrap
Text File
|
1988-02-22
|
2KB
|
133 lines
PatternMatch(33.4) ARP Programmers Manual PatternMatch(33.4)
NAME
PatternMatch - perform a wildcard match on a string
SYNOPSIS
result = PatterMatch(pat,str)
D0 A0 A1
FUNCTION
This function compares a string to the given pattern and
determines if it is a valid match. If so it returns a true
result. If you are calling FindFirst()/FindNext() this
function, and the related PreParse() function are called for
you. You will need this function to do pattern matching on
arbitrary text, for example, in a Search command in a text
editor, or in implementing a 'grep' program. The pattern
must be constructed with special preparsed tokens and
supports the following patterns:
(p1|p2|p3) One of the patterns p1, p2 or p3
? Any single character
#<pat> Pattern repeated 0 or more times
[class] Character class
[^class] Negated character class
{pat} Structure tag for replacement
* 0 or more occurances of any character
INPUTS
char *pat - The pattern string to match against, this is
only partially ascii, the wildcard strings must be
converted to the appropriate token value as given in
the arpbase.[ih] files. The easiest way to do this
is to pass the string to PatternMatch() (V33 of
arp.library).
char *str - The string to be matched
RESULT
result - a boolean value indicating success/failure.
BUGS
Character classes still do not work.
SEE ALSO
PreParse(), FindFirst(), FindNext(), FreeAnchorChain()
AUTHOR
Page 1 (printed 2/22/88)
PatternMatch(33.4) ARP Programmers Manual PatternMatch(33.4)
JAT
Page 2 (printed 2/22/88)