I have a RegExp
/h.*e.*l.*l.*o.*/i
And I have my paragraph that its being run on.
Hey look at that lion!
The result is this:
answer[0] = Hey look at that lion!
answer[1] = H
answer[2] = e
answer[3] = l
answer[4] = l
answer[5] = o
I was wondering if I could get a result like this:
answer[0] = Hey look at that lion!
answer[1] = Hello
by only changing my RegExp. Maybe using grouping or something? And if the answer to that question is no, then what are my other options? I really don't want to loop over the answer and string it together either, but if that's the only way then I will do it like that I suppose.