Skip to content

Commit

Permalink
Improve regex
Browse files Browse the repository at this point in the history
  • Loading branch information
MrEssex committed Jan 24, 2024
1 parent 6826af7 commit 7647fd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Cli/GenerateTPL.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ protected function _processFile($file)
{
$contents = file_get_contents($file->getPathname());
$regex = [
'/\$this->_\((?:\W?)*[\'"](.*)[\'"],(?:\W)*[\'"](.*)[\'"](?:,(?:[\W\w])*\])?(?:\W)*\)/' => '_processDefault',
'/\$this->_t\((?:\W?)*[\'"](.*)[\'"](?:,(?:[\W\w])*\])?(?:\W)*\)/' => '_processMD5',
'/\$this->_p\((?:\W?)*[\'"](.*)[\'"],(?:\W?)*(.*)[\'"],(?:\W\w)(?:\W\w?)*\)/' => '_processPlural',
'/\$this->_sp\((?:\W?)*[\'"](.*)[\'"],(?:\W\w)(?:\W\w?)*\)/' => '_processSimplePlural',
'/\$this->_\((?:\W?)*[\'"]([^\'"]*)[\'"],(?:[\W])*[\'"](.*)[\'"](?:,(?:[\W\w])*\])?(?:\W)*\)/' => '_processDefault',
'/\$this->_t\((?:\W?)*[\'"](.*)[\'"](?:,(?:[\W\w])*\])?(?:\W)*\)/' => '_processMD5',
'/\$this->_p\((?:\W?)*[\'"](.*)[\'"],(?:\W?)*(.*)[\'"],(?:\W\w)(?:\W\w?)*\)/' => '_processPlural',
'/\$this->_sp\((?:\W?)*[\'"](.*)[\'"],(?:\W\w)(?:\W\w?)*\)/' => '_processSimplePlural',

];

Expand Down

0 comments on commit 7647fd5

Please sign in to comment.