Acorn Arcade forums: Programming: Universal wildcard implementation?
|
Universal wildcard implementation? |
|
swirlythingy (14:23 25/5/2011) helpful (16:58 25/5/2011) Lampi (08:52 26/5/2011)
|
|
Martin Bazley |
Message #117819, posted by swirlythingy at 14:23, 25/5/2011 |
Posts: 460
|
I've been toying with the idea of adding wildcard support to MBBack for a while (although probably not in this release), but AFAICT I'll need direct access to the OS wildcard routine itself (# for one character, * for many), because although OS_GBPB accepts wildcards, OS_SpriteOp doesn't.
So, was there ever an API for a simple string-matching routine to see if a non-wildcarded string was valid according to a wildcarded one? Or did any third parties write one? Or does anyone have any idea how to write my own? |
|
[ Log in to reply ] |
|
Bryan Hogan |
Message #117820, posted by helpful at 16:58, 25/5/2011, in reply to message #117819 |
Member
Posts: 255
|
The RegEx module might be what you need:
http://www.fnxweb.com/software-acorn-regex.html |
|
[ Log in to reply ] |
|
James Lampard |
Message #117830, posted by Lampi at 08:52, 26/5/2011, in reply to message #117819 |
Posts: 190
|
There is an implementation of a wildcard routine in JFShared: REM Wildcard based on that in Acorn's CopyFiles DEFFNwildcard(test$,wild$) IFtest$<>""ELSEIFASCwild$=ASC"*"THEN=FNwildcard(test$,MID$(wild$,2))ELSE=(wild$="") IFwild$=""THEN=0 IF ASCtest$=ASCwild$ ORASCwild$=ASC"#"THEN=FNwildcard(MID$(test$,2),MID$(wild$,2)) IFASCwild$<>ASC"*"THEN=0 =FNwildcard(test$,MID$(wild$,2))ORFNwildcard(MID$(test$,2),wild$) |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: Universal wildcard implementation? |