[TxMt] useful snippet regex transformation

Quinn Comendant quinn at strangecode.com
Sun Apr 16 07:57:13 UTC 2006

I thought I'd share this useful transformation. It replaces all - or _
with a space and makes the first character uppercase.

<label for="${1:some_field}"><?php echo _("${3:${1/(^[^-_]+)?([-_]+)?/(?
1:\u$1)(?2: )/g}}"); ?></label>

...would generate something like...

<label for="funky_monkey"><?php echo _("Funky monkey"); ?></label>


More information about the textmate mailing list