我已经创建了一个带有Intellij思想的实时模板,我正在尝试查找和删除一个特定的
String
在通过A的速度范围内
variable
但是失败了
我试图设置
$moduleName
变量通过
$NAME
变量
-它给出了“文件名”-
具有
RegExp
.
我正在移除
View
创建JS文件时出现字符串(文件名的一部分),但失败。代码:
## Input for 'File Name' is FooView**
#set($regex = '/(View)/') ## Try to get 'View' string with regex**
#set($checkRegex = $NAME.matches($regex)) ## Checks if regex finds**
#set($moduleName = $NAME.replaceAll($regex, '')) ## Try to remove 'View' string on $NAME variable**
## So the results;**
$checkRegex ## Returns as FALSE**
$moduleName ## Still returns all input as 'FooView'**