I have the following regex to capture translation strings in a laravel project:
(trans|trans_choice|Lang::get|Lang::choice|Lang::trans|Lang::transChoice|@lang|@choice)\(([\'"]([\/a-zA-Z0-9_-]+([.][^)\'"]+?)+)[\'"])(\s?.*,\s?.*)*?[\)\]];?
The regex will happily capture:
@lang('validation.invalid')
@lang('validation.invalid', ['field' => $field])
However, the moment I introduce a line break
@lang('validation.invalid', [
'field' => $field
])
or a couple in between:
@lang('validation.invalid', [
'field' => $field,
'message' => $error->getMessage()
])
It no longer targets the string