regex Как вытащить название магазина из данной строки?
Finish: Painted(write color)
Personalization: Could you please paint this in gold? If there's no gold,
the "honey" color is fine
Магазин: Wooden Reds_76
Идентификатор транзакции: 2064208676
Количество: 1
Цена: 39,95 US$
Personalized item
Нужно достать строку "Wooden Reds_76"
У меня получилось только буквы: .*Магазин: (\w+), но в названии могут быть ещё и цифры, и пробелы
Ответы (2 шт):
Автор решения: dIm0n
→ Ссылка
Вот так вот:
(?<=Магазин:\h).*
Finish: Painted(write color) Personalization: Could you please paint this in gold? If there's no gold, the "honey" color is fine Магазин: Wooden Reds_76 Идентификатор транзакции: 2064208676 Количество: 1 Цена: 39,95 US$ Personalized item
Автор решения: Qwertiy
→ Ссылка
Магазин:\s*([^\r\n]*)
console.log(`
Finish: Painted(write color)
Personalization: Could you please paint this in gold? If there's no gold,
the "honey" color is fine
Магазин: Wooden Reds_76
Идентификатор транзакции: 2064208676
Количество: 1
Цена: 39,95 US$
Personalized item
`.match(/Магазин:\s*([^\r\n]*)/)[1])