正则表达式将Javascript Webstorm IDE中指定的小写字符替换为大写字符
我使用以下代码进行编码:正则表达式将Javascript Webstorm IDE中指定的小写字符替换为大写字符,javascript,regex,Javascript,Regex,我使用以下代码进行编码: 'box-sizing': 'border-box', 'user-select': 'none', 我必须将其转换为: 'boxSizing': 'border-box', 'userSelect': 'none', 'boxSizing': 'border-box', 'userSelect': 'none', 我尝试使用Webstorm的正则表达式替换正则表达式: (?<='\w+)-(\w)(?=\w+':) 但是它失败了,因为它与任何内容都不匹配
'box-sizing': 'border-box',
'user-select': 'none',
我必须将其转换为:
'boxSizing': 'border-box',
'userSelect': 'none',
'boxSizing': 'border-box',
'userSelect': 'none',
我尝试使用Webstorm的正则表达式替换正则表达式:
(?<='\w+)-(\w)(?=\w+':)
但是它失败了,因为它与任何内容都不匹配。假设在IntelliJ IDE的搜索/替换字段中选择了regex 在搜索字段中:
(.*?)(\-)(.*?\':)
在替换字段中:
$1\u$3
点击“替换”。它应该转变
'box-sizing': 'border-box',
'user-select': 'none',
进入
'boxSizing': 'border-box',
'userSelect': 'none',