Skip to content

Instantly share code, notes, and snippets.

@AndyG
Last active February 28, 2018 05:23
Show Gist options
  • Save AndyG/381adc4bb9516cf3089b652d65afa18f to your computer and use it in GitHub Desktop.
Save AndyG/381adc4bb9516cf3089b652d65afa18f to your computer and use it in GitHub Desktop.
Fixed Rule
for (rule in rules) {
val matcher = rule.matcher.reset(mutableSource) // Faster than creating a new Matcher
if (matcher.find()) {
// Do stuff with the rule that matched the text
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment