@@ -0,0 +1,1295 @@
+/*%0A * Copyright (C) 2014, C. Ramakrishnan / Auracle.%0A * All rights reserved.%0A *%0A * This code is licensed under the BSD 3-Clause license.%0A * See file LICENSE (or LICENSE.html) for more information.%0A */%0A%0Apackage com.illposed.osc.messageselector;%0A%0Aimport com.illposed.osc.MessageSelector;%0Aimport com.illposed.osc.OSCMessage;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * Checks whether an OSC %3Ci%3EArgument Type Tags%3C/i%3E string matches a given Java regular expression.%0A */%0Apublic class JavaRegexTypeTagsMessageSelector implements MessageSelector %7B%0A%0A%09private final Pattern selector;%0A%0A%09public JavaRegexTypeTagsMessageSelector(final Pattern selector) %7B%0A%09%09this.selector = selector;%0A%09%7D%0A%0A%09public JavaRegexTypeTagsMessageSelector(final String selectorRegex) %7B%0A%09%09this(Pattern.compile(selectorRegex));%0A%09%7D%0A%0A%09public static MessageSelector createAddressAndTypeTagsSelector(%0A%09%09%09final Pattern addressSelector,%0A%09%09%09final Pattern typeTagsSelector)%0A%09%7B%0A%09%09return new CombinedMessageSelector(%0A%09%09%09%09new JavaRegexAddressMessageSelector(addressSelector),%0A%09%09%09%09new JavaRegexTypeTagsMessageSelector(typeTagsSelector));%0A%09%7D%0A%0A%09@Override%0A%09public boolean isInfoRequired() %7B%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public boolean matches(final OSCMessage message) %7B%0A%09%09return selector.matcher(message.getInfo().getArgumentTypeTags()).matches();%0A%09%7D%0A%7D%0A

introduce `JavaRegexTypeTagsMessageSelector`