本文整理了Java中java.util.regex.Matcher.useTransparentBounds()
方法的一些代码示例,展示了Matcher.useTransparentBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matcher.useTransparentBounds()
方法的具体详情如下:
包路径:java.util.regex.Matcher
类名称:Matcher
方法名:useTransparentBounds
[英]Determines whether this matcher has transparent bounds enabled or not. When transparent bounds are enabled, the parts of the input outside the region are subject to lookahead and lookbehind, otherwise they are not. Transparent bounds are disabled by default.
[中]确定此匹配器是否启用了透明边界。当启用透明边界时,区域外的输入部分将受“向前看”和“向后看”约束,否则不受约束。默认情况下禁用透明边界。
代码示例来源:origin: robovm/robovm
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: vdurmont/emoji-java
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;
}
代码示例来源:origin: stackoverflow.com
final int end = source.length();
Matcher m = Pattern.compile("dummy").matcher(source);
m.useTransparentBounds(true).useAnchoringBounds(false);
while (pos < end)
代码示例来源:origin: kite-sdk/kite
/**
* Sets the transparency of region bounds for this matcher.
*
* @param b a boolean indicating whether to use opaque or transparent regions
* @return this Matcher
*/
public Matcher useTransparentBounds(boolean b) {
matcher.useTransparentBounds(b);
return this;
}
代码示例来源:origin: org.kitesdk/kite-morphlines-core
/**
* Sets the transparency of region bounds for this matcher.
*
* @param b a boolean indicating whether to use opaque or transparent regions
* @return this Matcher
*/
public Matcher useTransparentBounds(boolean b) {
matcher.useTransparentBounds(b);
return this;
}
代码示例来源:origin: sonia.regexp/named-regexp
public NamedMatcher useTransparentBounds(boolean b) {
matcher.useTransparentBounds(b);
return this;
}
代码示例来源:origin: ibinti/bugvm
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: MobiVM/robovm
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: com.bugvm/bugvm-rt
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: com.jtransc/jtransc-rt
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: com.gluonhq/robovm-rt
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: ripreal/V8LogScanner
public RgxReader(CharBuffer source) {
pattern = Pattern.compile(EVENT_RGX, Pattern.DOTALL);
buf = source;
matcher = pattern.matcher(buf);
buf.position(position);
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
result = new ArrayList<>(limit);
}
代码示例来源:origin: FlexoVM/flexovm
private void resetMatcher() {
if (matcher == null) {
matcher = delimiter.matcher(buffer);
} else {
matcher.reset(buffer);
}
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
matcher.region(findStartIndex, bufferLength);
}
代码示例来源:origin: com.github.rwitzel.streamflyer/streamflyer-core
/**
* @return Returns the matcher that can be used with a {@link RegexModifier} to match an alternative of tokens
*/
protected OnStreamMatcher createMatcher(String regexTokenAlternatives) {
// use the default implementation
Matcher matcher = Pattern.compile(regexTokenAlternatives, 0).matcher("");
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
return new OnStreamStandardMatcher(matcher);
}
代码示例来源:origin: com.googlecode.streamflyer/streamflyer-core
/**
* @return Returns the matcher that can be used with a {@link RegexModifier} to match an alternative of tokens
*/
protected OnStreamMatcher createMatcher(String regexTokenAlternatives) {
// use the default implementation
Matcher matcher = Pattern.compile(regexTokenAlternatives, 0).matcher("");
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
return new OnStreamStandardMatcher(matcher);
}
代码示例来源:origin: com.googlecode.streamflyer/streamflyer-core
/**
* See {@link #RegexModifier(String, int, String, int, int)}.
*/
public RegexModifier(String regex, int flags, MatchProcessor matchProcessor, int minimumLengthOfLookBehind,
int newNumberOfChars) {
Matcher jdkMatcher = Pattern.compile(regex, flags).matcher("");
jdkMatcher.useTransparentBounds(true);
jdkMatcher.useAnchoringBounds(false);
init(new OnStreamStandardMatcher(jdkMatcher), matchProcessor, minimumLengthOfLookBehind, newNumberOfChars);
}
代码示例来源:origin: com.github.rwitzel.streamflyer/streamflyer-core
/**
* See {@link #RegexModifier(String, int, String, int, int)}.
*/
public RegexModifier(String regex, int flags, MatchProcessor matchProcessor, int minimumLengthOfLookBehind,
int newNumberOfChars) {
Matcher jdkMatcher = Pattern.compile(regex, flags).matcher("");
jdkMatcher.useTransparentBounds(true);
jdkMatcher.useAnchoringBounds(false);
init(new OnStreamStandardMatcher(jdkMatcher), matchProcessor, minimumLengthOfLookBehind, newNumberOfChars);
}
代码示例来源:origin: com.github.rwitzel.streamflyer/streamflyer-core
protected OnStreamMatcher createMatcher(String regex, int flags) {
Matcher matcher = Pattern.compile(regex, flags).matcher("");
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
return new OnStreamStandardMatcher(matcher);
}
代码示例来源:origin: com.googlecode.streamflyer/streamflyer-core
protected OnStreamMatcher createMatcher(String regex, int flags) {
Matcher matcher = Pattern.compile(regex, flags).matcher("");
matcher.useTransparentBounds(true);
matcher.useAnchoringBounds(false);
return new OnStreamStandardMatcher(matcher);
}
内容来源于网络,如有侵权,请联系作者删除!