I want make findfirst() function Case-insensitive. I want to extract texts after Filter word in webpages text. Some webpages contains it as FILTER and some as Filter. How to make them equivalent ?
while for other webpages that contains Filter it shows correct output
For detailed understanding visit Get index corresponding to some number in list of outputs - #14 by raman_kumar
Maybe use a regex to compare with?
suppose if some webpage contains it as_filter_ or FILter then what should i do ?
I mean isn’t there way to make it case-insensitive.
If you add
i after the regex it becomes case-insensitive:
You could do something like this or add an ‘i’
cp=collect(partition("abc fli FiLteR nmb",6,1))
findfirst(p->all(t->t ∈ t, zip(p,zip("filter","FILTER"))), cp)
function imatch(s, patt)
for i in eachindex(cp)
all(t->t ∈ t, zip(cp[i],zip(lowercase(patt),uppercase(patt)))) ? (return i) : continue
s="abc fli FiLteR nmb"