my problem is, I try to strip a string at a start of a variable. I have done shopt -s exglob
to get extended pattern matching.
a="HelloDolly"
echo "${a#[A-Z]+([a-z])}"
I thought that +([a-z])
mean as much lower case letter as possible. And that [A-Z]+([a-z])
should match Hello
should return Dolly but I get lloDolly
back. If give /
instead #
a try
echo "${a/[A-Z]+([a-z])}"
I get back nothing. Looks like the Parameter Expansions is caseinsensitive.
Thanks everybody who could give me an hint.