Sublime snippet change case as well as replace underscores with spaces in mirrored text

核能气质少年 提交于 2019-12-04 07:21:32

{{ Form::label('$1', '${1/^(\w)|(_(\w))/(?1:\u\1:)(?2: \u\3:)/g}') }}

Sublime Text uses Boost regular expressions which support conditionals.

<snippet>
    <content><![CDATA[
<div class="form-group">
    {!! Form::label('${1:text}', '${1/(^|_)(.)/$1\u$2/g}:') !!}
    {!! Form::text('${1:text}', null, ['class' => 'form-control']) !!}
</div>
]]></content>
<!-- {!! Form::label('${1:text}', '${1/_/\ /-/g}:') !!} -->
<tabTrigger>textfield</tabTrigger>

The above gets close, but not quite there. It capitalizes the letter after the underscore. The commented out line replaces underscores with spaces... I just can't figure out how to combine the two of them :/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!