如何编写模板变量在Netbeans中转换大写|小写| captalize?

Bru*_*sta 8 netbeans

我需要将相同的变量转换为大写|小写| captalize.

/**
 * @package     ${1 default="Hello"}
 * @subpackage  ${com}_${1 capitalize=false}
 * @copyright   Copyright (C) 2012 ${AtomTech}, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined('_JEXEC') or die;
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

Ed *_*nds 9

大写

${name?upper_case}
Run Code Online (Sandbox Code Playgroud)

小写

${name?lower_case}
Run Code Online (Sandbox Code Playgroud)

大写

${name?capitalize}
Run Code Online (Sandbox Code Playgroud)

Netbeans使用FreeMarker作为其模板语言.特定于您的请求的文档位于有关字符串的页面上.


Bru*_*sta 2

解决起来很简单,看:

${1/(.+)/\L\1/g}

${var_name/regex/format_string/options}

var_name = 1

regex = (.+)

format_string = \L\1 (can use l|L|u|U)

options = g

更多内容请参见http://sublimetext.info/docs/en/reference/snippets.html