# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/select\[([^\s]*(?<param>[a-z0-9]+)[^,\s]*)*\]/\1/g;t' <<< "select[ 1, 22 ,word, two words ]
attempting to load capture group with (numerics or alpha-num options) from comma separated list ignoring leading/trailing whitespace of each param but preserving space between words (ie \"two words).
results like
param1: \"1\"
param2: \"22\"
param3: \"word\"
param4: \"two words\"
once thats sorted, would liek to handle optional single quote ' around parameters.
Thanks for the consideration
"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html