本文整理匯總了Java中java.util.regex.Matcher.useTransparentBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java Matcher.useTransparentBounds方法的具體用法?Java Matcher.useTransparentBounds怎麽用?Java Matcher.useTransparentBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.regex.Matcher
的用法示例。
在下文中一共展示了Matcher.useTransparentBounds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAliasCandidates
import java.util.regex.Matcher; //導入方法依賴的package包/類
private static List<AliasCandidate> getAliasCandidates(String input) {
List<AliasCandidate> candidates = new ArrayList<AliasCandidate>();
Matcher matcher = ALIAS_CANDIDATE_PATTERN.matcher(input);
matcher = matcher.useTransparentBounds(true);
while (matcher.find()) {
String match = matcher.group();
if (!match.contains("|")) {
candidates.add(new AliasCandidate(match, match, null));
} else {
String[] splitted = match.split("\\|");
if (splitted.length == 2 || splitted.length > 2) {
candidates.add(new AliasCandidate(match, splitted[0], splitted[1]));
} else {
candidates.add(new AliasCandidate(match, match, null));
}
}
}
return candidates;
}
示例2: getAliasCandidates
import java.util.regex.Matcher; //導入方法依賴的package包/類
protected static List<AliasCandidate> getAliasCandidates(String input) {
List<AliasCandidate> candidates = new ArrayList<AliasCandidate>();
Matcher matcher = ALIAS_CANDIDATE_PATTERN.matcher(input);
matcher = matcher.useTransparentBounds(true);
while (matcher.find()) {
String match = matcher.group();
if (!match.contains("|")) {
candidates.add(new AliasCandidate(match, match, null));
} else {
String[] splitted = match.split("\\|");
if (splitted.length == 2 || splitted.length > 2) {
candidates.add(new AliasCandidate(match, splitted[0], splitted[1]));
} else {
candidates.add(new AliasCandidate(match, match, null));
}
}
}
return candidates;
}