I have a following value “1pm 2am” that I’m using a regular expression againts in SSIS to extract hours from in order to store separately. I’ve tried using both of the regular expressions below but both only yield the first number “1”.
"(\d+)"
"(\*?\d{1,2}\*?)"
Am I missing something obvious?
Use
Regex.matchesinstead ofRegex.match.Regex.matchesreturns a collection of all matches.Your regex can just be\d+` by itself.