@Tom-Elliott We had case originally I believe, but it has more limited pattern matching, it wouldn’t work at all at the time.
I think it’s ultimately just going to be struggling with accented letters no matter what we do. Even cheeky capture methods like [D-Fd-f] don’t work to capture é in the inits (but does on something like Centos 7 or even online shell sandboxes.
I’m not sure WHY that is, though.
Basically, ? in the if statement regex = Wildcard for one or more characters. You were, I presume, using [Dd] as an “if d exists or not, let’s be true” kind of scenario?
I don’t think it has to do with the e or accented e’s, just plain it doesn’t know what to match and what not.
Yes, that was the original idea, which works in certain environments I suppose, but should definitely be replaced with a wild card instead. (along with [Dd])
However, even when removing that bit, it still fails to match. It so far has only worked with
[Rr]*[Ss][Ee][Rr][Vv]* as the pattern.
[Rr][EeÉé][Ss][Ee][Rr][Vv][EeÉé]* does not work.
I’m thinking that perhaps using grep to do the matching might be more consistent and predictable in its behavior.
Something like:
echo $label | grep -iq "R[ée]serv[ée]"