Here's the snippet:
- Code: Select all
<?php \$${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}} = new Area("${1:Main}"); \$$2->display(\$c); ?>
When activated, it selections Main, and if I were to type something like, "Sidebar Footer," the expected outcome (and actual outcome in TextMate) is:
- Code: Select all
<?php $sidebar_footer = new Area("Sidebar Footer"); $sidebar_footer->display($c); ?>
But the actual output in Sublime is:
- Code: Select all
<?php $sidebar_ footer = new Area("Sidebar Footer"); $sidebar_ footer->display($c); ?>
The extra spaces shouldn't be there. I consider myself pretty good with regular expressions, but this is probably one of the extremely few times I've had to use the syntax with the search and replace in one line.
Basically
- Code: Select all
Sidebar Footer/[[:alpha:]]+|( )/(?1:_:\L$0)/g
Specifically, it seems to be prepending the space with an underscore instead of replacing the space with an underscore.
Thanks,
CWSpear