|
Hello;
I'm trying to write a code for checking whether a string containing wildcards is a substring of a string T.
I mean for a given pattern P over {a,b,c,d,$} for which $ is a wildcards (of length 1), and a text T over {a,b,c,d}, I'd like to return true iff P appears in T.
Example:
when T=ababcadcdbbad, _____P=c$$$d$ba then the answer should be true cause T=ababcadcdbbad, ____P=c$$$d$ba,
but for P=c$$$d$a then its false since T=ababcadcdbbad, ________P=c$$$d$_a
and for P=a$$$a the answer should be false cause there is no substring of T that starts and ends with an 'a' and with (exactly) 3 wildcards between.
I could only find procs for matching a substring without wildcards.
Thanks a lot!
This post has been edited by babasmith: 2 Apr, 2006 - 12:30 PM
|