Last active
October 18, 2017 21:02
-
-
Save Frogli/e7ffe17f8d925aea72783f860d823a50 to your computer and use it in GitHub Desktop.
Omnis Studio Regular Expression search using java.util.regex.Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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