-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
2 additions
and
133 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,43 +22,18 @@ | |
* @author Andres Almiray <a href="mailto:[email protected]">[email protected]</a> | ||
*/ | ||
public class RegexpUtils { | ||
private static String javaVersion = "1.3.1"; | ||
|
||
static { | ||
javaVersion = System.getProperty("java.version"); | ||
} | ||
|
||
/** | ||
* Returns a RegexpMatcher that works in a specific environment.<br> | ||
* When in a JVM 1.3.1 it will return a Perl5RegexpMatcher, if the JVM is | ||
* younger (1.4+) it will return a JdkRegexpMatcher. | ||
*/ | ||
public static RegexpMatcher getMatcher(String pattern) { | ||
if (isJDK13()) { | ||
return new Perl5RegexpMatcher(pattern); | ||
} else { | ||
return new JdkRegexpMatcher(pattern); | ||
} | ||
return new JdkRegexpMatcher(pattern); | ||
} | ||
|
||
/** | ||
* Returns a RegexpMatcher that works in a specific environment.<br> | ||
* When in a JVM 1.3.1 it will return a Perl5RegexpMatcher, if the JVM is | ||
* younger (1.4+) it will return a JdkRegexpMatcher. | ||
*/ | ||
public static RegexpMatcher getMatcher(String pattern, boolean multiline) { | ||
if (isJDK13()) { | ||
return new Perl5RegexpMatcher(pattern, true); | ||
} else { | ||
return new JdkRegexpMatcher(pattern, true); | ||
} | ||
} | ||
|
||
/** | ||
* Queries the environment for the supported JDK version. | ||
*/ | ||
public static boolean isJDK13() { | ||
return javaVersion.indexOf("1.3") != -1; | ||
return new JdkRegexpMatcher(pattern, multiline); | ||
} | ||
|
||
private RegexpUtils() {} | ||
|
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
35 changes: 0 additions & 35 deletions
35
src/test/java/net/sf/json/regexp/TestPerl5RegexpMatcher.java
This file was deleted.
Oops, something went wrong.