Skip to content

Instantly share code, notes, and snippets.

@Frogli
Last active October 18, 2017 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frogli/e7ffe17f8d925aea72783f860d823a50 to your computer and use it in GitHub Desktop.
Save Frogli/e7ffe17f8d925aea72783f860d823a50 to your computer and use it in GitHub Desktop.
Omnis Studio Regular Expression search using java.util.regex.Pattern
; Omnis Studio regex search using Java libary java.util.regex.Pattern. For more information about this libary see
; http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
; Do a match on a string. The string has to match the regex completely
; Lines 2-4 can either be done be define the variables in variable pane of the class editor or with notation.
; see http://www.omnis.net/documentation/extendingomnis/index.jsp?detail=03javaobjs.html#defining-java-objects
Variable: RegexString Object JavaObjs Librar.JavaObjs\System\java\lang\String
Variable: TargetString Object JavaObjs Librar.JavaObjs\System\java\lang\String
Variable: Pattern.JavaObjs Library.JavaObjs\System\java\util\regex\Pattern
Do RegexString.$createobject("^([1-9]{1,5}[a-z]).*?")
Do TargetString.$createobject("1d1t")
Do Pattern.$matches(RegexString, TargetString) Returns result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment