Say I have a start string, call it "beg", and an end string, call it "rem", is there a way such that I can perform a grep where a "no character" specification can be included (instead of the "*") as an option along with the other characters specified within the square brackets in following command:
grep "${beg}"'[-_*]'"${rem}"
Also, is there a way to specify the pattern " - " (space, hyphen, space) instead of that "[*]" ? Meaning, any (and only) one of
I am not a regex guru... And I do use basic regex syntax mainly.
IMHO, the two forms are not equivalent. AFAIK, (?:value) is extended (perl-inspired) syntax for non-capturing grouping, whatever it is intended to mean. They say, one creates non-capturing group when it is not needed for matching. I do not know how such the groups are used.
Parenthesis in (value)? create capturing group and allow to treat the 'value' as an 'atom', i.e. question mark works as one or zero match operator.
Thank you, Eugene. I wanted to give you credit for the simplified form, but in the end, I realized that the original solution was the one that "detailed" the formulation of the expression to fit my original problem statement. So I hope you didn't mind my re-assigning that back to that solution.