$re = '/(?<=t\(\').+?(?=\'\))|(?<=t\(").+?(?="\))|(?<=t\(`).+?(?=`\))|(?<=t\(").+?(?=", {)|(?<=t\(\').+?(?=\', {)|(?<=t\(`).+?(?=`, {)/m';
$str = '{
id: 11,
image: \'best-broker-latin-america.jpg\',
title: this.$t("TEXT"),
description: \\`<p><span>${ this.$t("TEXT") }</span> <span>${ this.$t("TEXT", { company: \'LiteFinance\' }) }</span></p>\\`
},
$t(\'TEXT\')
$t("TEXT")
$t("TEXT", { link: \'#\', company: \'LiteFinance\' })
$t(\'TEXT\', { link: \'#\', company: \'LiteFinance\' })
$t(\'TEXT "TEXT" TEXT\')
$t(`TEXT`)
$t(`TEXT`, { link: \'#\', company: \'LiteFinance\' })
С ПЕРЕНОСАМИ
${ this.$t(\'TEXT\', { company: this.$global.company }) }
${ this.$t(\'TEXT\', { num: this.bonus }) }
ОДНОЙ СТРОКОЙ
${ this.$t("TEXT", { company: this.$global.company }) } ${ this.$t("TEXT", { num: this.bonus }) }
`${ this.$t(\'TEXT\', { company: this.$global.company }) }${ this.$t(\'TEXT\', { num: this.bonus }) }`
asyncData({ store, i18n }) {
// breadcrumbs
store.commit(\'breadcrumbs/setCrumbs\', [
{
name: i18n.t(\'TEXT\'),
url: \'/\'
},
{
name: i18n.t(\'TEXT\'),
url: \'/about\'
},
{
name: i18n.t(\'TEXT\')
}
])
},
case \'cryptocurrencies\':
return this.$t(\'TEXT\', { company: this.$global.company, num: this.$global.companyAge });
case \'currencies\':
return this.$t(\'TEXT TEXT TEXT\', {
company: this.$global.company,
num: this.$global.companyAge
}
);
case \'cryptocurrencies\':';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php