在 smartgwt 中使用 String.matches(regex)
我与 smartgwt 合作已经三个月了。 我遇到了一个关于string类的具体方法的问题。
似乎匹配永远不会起作用,即使是最简单的匹配:
String regex = "CEDD";
String input = "CEDD";
input.matches(regex);
这总是返回 false。这段代码位于扩展 smartgwt Layout 类的类中,因此被转换为 js 并在前端使用。 当在简单的 java main 独立类中使用时,相同的片段显然可以工作。
您能指出要调查什么来解决这个问题吗?
谢谢
I am working with smartgwt since three months.
I have encountered a problem with the specific method of the string class.
It seems that the matches never works, even with the simplest one:
String regex = "CEDD";
String input = "CEDD";
input.matches(regex);
this will always returns false. Such piece of code is within a class extending the smartgwt Layout class, and therefore got converted to js and used in front end.
The same fragment obviously works when used in a simple java main standalone class.
Could you point out what to investigate to solve this problem ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来GWT不支持普通的Java正则表达式(即不支持
Pattern
、Matcher
和使用它的类/方法有一个
正则表达式 class
。
It looks like GWT doesn't support normal Java regular expressions (i.e. doesn't support
Pattern
,Matcher
and classes/methods that use it.There is a
RegExp
class that provides those features, however.