-1

These two strings:

AMZN Mktp COM*TB125G03 WWW.AMAZON.COM
AMZ#zebra100 WWW.AMAZON.COM

should return up to the first three words like this from a regex:

AMZN Mktp COM
AMZ WWW.AMAZON.COM

so basically, truncate words upon encountering a certain token, in this case, "*" or "#", and then return up to 3 words.

I've gotten this far, which returns the correct number of words, but fails when the token is encountered

(([^#* ]+ ){1,3})
eplictical
  • 583
  • 1
  • 6
  • 16

0 Answers0