I need to convert string containing wildcards with a regexp.
For example, if I have an input string like below:
ab*dd*c
This means
ab(any number of any characters)d(any number of any characters)c
Where any character
is any alphanumeric character or '_'.
I've tried something like below:
'ab([[:alnum]] | '_')*dd([[:alnum]] | '_')*c'
But, as you can see, for, example, ([[:alnum]] | '\_')*
matches d
also, and, so, I couldn't get needed match.
What comes to mind is use something like below:
'ab[^ d]*dd[^ c]*c'
Is there another better solution?
Thanks in advance!