小编but*_*cup的帖子

使用 thymeleaf 使用正则表达式从字符串中删除所有特殊字符

我是 thymeleaf 的新手,最近我部分弄清楚了如何从字符串中删除特殊字符。以下代码有效,但我必须替换每个特殊字符。

${#strings.toLowerCase(#strings.replace(#strings.replace(#strings.replace(name, '''','-'), '&',''),' ','-'))}
Run Code Online (Sandbox Code Playgroud)

有没有办法让我可以使用单个正则表达式来使用 thymeleaf 从字符串中删除所有特殊字符?

regex special-characters thymeleaf

4
推荐指数
1
解决办法
3048
查看次数

标签 统计

regex ×1

special-characters ×1

thymeleaf ×1