0

I'm trying to find a string that is surrounded by anything that isn't letters, however I need it to also ignore the newline character of \n cause that's in the string directly

My current regex, using .exec. I need to get just the match and ignore what's in the noncapturing groups

'(?:^|\\s|[,.]|\n)(' + tempReg + ')(?:$|\\s|[,."])'

This is the string it should search, right to the end of the post code. Everything following are recognized components, and one of those should say Birmingham, however it does not. There's also quotes in the original string that I tried to account for being in the way with the regex, as seen above

United Kingdom,,,B4 6AR,Colmore Circus\nBirmingham,B4 6AR,COMPONENT NOT FOUND,COMPONENT NOT FOUND,COMPONENT NOT FOUND,COMPONENT NOT FOUND,COMPONENT NOT FOUND,United Kingdom,
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563

0 Answers0