开发者

Regex class not working on server side of GWT

开发者 https://www.devze.com 2023-01-09 13:06 出处:网络
I\'ve the following piece of code in the server folder of the module. Pattern regex = Pattern.compile(\"/(B[A-Z0-9]{9})/\");

I've the following piece of code in the server folder of the module.

Pattern regex = Pattern.compile("/(B[A-Z0-9]{9})/");
Matcher matcher = regex.matcher(detailPageUrl);

But I still get the following errors:

[ERROR] Line 14: The import java.util.regex cannot be resolved
[ERROR] Line 15: The import java.util.regex cannot be resolved
[ERROR] Line 202: Pattern cannot be resolved to a type
[ERROR] Line 202: Pattern cannot be resolved
[ERROR] Line 203: Matcher cannot be resolved to a type

I've imported

import java.util.regex.Matcher;
import java.util.regex.Pattern;

in the code.

I开发者_如何学编程 thought that Regex will work on the server side. Why is this not working?


Check out the Java environment first. Like the Java version, classpath, etc. The error clearly states that the package cannot be imported due to some reason.

0

精彩评论

暂无评论...
验证码 换一张
取 消