Seems to me that people made part 2 harder than it us. Just define an array containing the digits: "one", "two", and so forth. Then check for substring matches, position by position. Maybe not elegant, but effective.
Not elegant but still do the job.
https://github.com/xdavidliu/advent-of-code/blob/main/2023/d...