Help with RegEx

I’m trying to extract a number of hours from a string. Here’s my formula:

If(
thisRow.[Double click and paste 1 time entry per row, or write it].RegexMatch("\d (hour|hr)"),
RegexReplace(thisRow.[Double click and paste 1 time entry per row, or write it],"[\s\S](\d+)(?= hour| hr)[\s\S]","$1"),
“”)

If the text reads “someText 12 hrs”, I want to extract “12”, but the result is always a single digit. Can anyone help? Example here:

oh got it:

If(
  thisRow.[Double click and paste 1 time entry per row, or write it].RegexMatch("\d (min|minutes)"),
  RegexReplace(thisRow.[Double click and paste 1 time entry per row, or write it],"[\s\S]*(\b\d+\b) (min|minute)[\s\S]*","$1"),
"")
3 Likes