I’m simply trying to build a Python regex to fully match and group a substring starting with at least one alpha character followed by at least one character from [_-d]+.
What I have tried so far is
re.fullmatch(r'([a-z]+?)[_-d]+',term)
. I’ve tried dozens of variations but so far no go.
Example: “input_4” -> ‘input’ (group 1) ‘_4’.
New contributor
Marshall Mayberry is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.