I'm trying to improve with regex as I'm tired of constantly having to look up existing solutions instead of creating my own. Having a bit of difficulty understanding why this isn't working though:
Trying to extract both phone numbers from the following string (numbers and address are random):
+1-541-754-3010 156 Alphand_St. <J Steeve>\n 133, Green, Rd. <E Kustur> NY-56423 ;+1-541-914-3010\n"
So I'm using the following expression:
/\+(.+)(?:\s|\b)/
These are the matches I'm getting back:
- 1-541-754-3010 156 Alphand_St.
- 1-541-914-3010
So I'm getting the last one correctly, but not the first one. Based on the expression, it should match anything from between a + and a space/boundary. But for some reason it's not stopping at the space after the first number. Am I going about this the wrong way?