public static Collection<MessageFragmentStyle> colorizeRegex(Style style, String text, int offset, Pattern regex, int group) {
    Collection<MessageFragmentStyle> messageFragmentStyles = colorizeRegex(style, text.substring(offset), regex, group);
    return increaseOffset(messageFragmentStyles, offset);
  }
Apply styles on StyledDocument using regular expression

@param style
         style to apply
@param text
         text to be tested by regular expression, fragment from document
@param regex
         regular expression
@param group
         group to apply
olv-core/src/main/java/pl/otros/logview/gui/message/MessageColorizerUtils.java