private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
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; }
final int end = source.length(); Matcher m = Pattern.compile("dummy").matcher(source); m.useTransparentBounds(true).useAnchoringBounds(false); while (pos < end)
/** * 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; }
/** * 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; }
public NamedMatcher useTransparentBounds(boolean b) { matcher.useTransparentBounds(b); return this; }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
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); }
private void resetMatcher() { if (matcher == null) { matcher = delimiter.matcher(buffer); } else { matcher.reset(buffer); } matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); matcher.region(findStartIndex, bufferLength); }
/** * @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); }
/** * @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); }
/** * 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); }
/** * 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); }
protected OnStreamMatcher createMatcher(String regex, int flags) { Matcher matcher = Pattern.compile(regex, flags).matcher(""); matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); return new OnStreamStandardMatcher(matcher); }
protected OnStreamMatcher createMatcher(String regex, int flags) { Matcher matcher = Pattern.compile(regex, flags).matcher(""); matcher.useTransparentBounds(true); matcher.useAnchoringBounds(false); return new OnStreamStandardMatcher(matcher); }