/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,final String flags) throws ParserException {
super(pattern,flags);
int option = Option.SINGLELINE;
if (this.isIgnoreCase()) {
option |= Option.IGnorECASE;
}
if (this.isMultiline()) {
option &= ~Option.SINGLELINE;
option |= Option.NEGATE_SINGLELINE;
}
try {
RegExpScanner parsed;
try {
parsed = RegExpScanner.scan(pattern);
} catch (final PatternSyntaxException e) {
// refine the exception with a better Syntax error,if this
// passes,just rethrow what we have
Pattern.compile(pattern,0);
throw e;
}
if (parsed != null) {
final char[] javaPattern = parsed.getJavaPattern().tochararray();
this.regex = new Regex(javaPattern,javaPattern.length,option,Syntax.JAVASCRIPT);
this.groupsInNegativeLookahead = parsed.getGroupsInNegativeLookahead();
}
} catch (final PatternSyntaxException | JOniException e2) {
throwParserException("Syntax",e2.getMessage());
}
}
项目:openjdk-jdk10
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:openjdk-jdk10
文件:JoniTest.java
@Test
public void testDump() {
new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpTree();
new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpByteCode();
new Regex("(abc){4,}{2,5}").dumpTree();
new Regex("(abc){4,5}").dumpByteCode();
new Regex("aaa|aa|bbbb|ccc").dumpTree();
new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
}
项目:openjdk9
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:openjdk9
文件:JoniTest.java
@Test
public void testDump() {
new Regex("^a{3,5}").dumpByteCode();
new Regex("aaa|aa|bbbb|ccc").dumpTree();
new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
}
项目:kaziranga
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:kaziranga
文件:JoniTest.java
@Test
public void testDump() {
new Regex("^a{3,5}").dumpByteCode();
new Regex("aaa|aa|bbbb|ccc").dumpTree();
new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
}
项目:lookaside_java-1.8.0-openjdk
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:lookaside_java-1.8.0-openjdk
文件:JoniTest.java
@Test
public void testDump() {
new Regex("^a{3,5}").dumpByteCode();
new Regex("aaa|aa|bbbb|ccc").dumpTree();
new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
}
项目:jdk8u_nashorn
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:jdk8u_nashorn
文件:JoniTest.java
@Test
public void testDump() {
new Regex("^a{3,5}").dumpByteCode();
new Regex("aaa|aa|bbbb|ccc").dumpTree();
new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
}
项目:infobip-open-jdk-8
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:OLD-OpenJDK8
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,0);
throw e;
}
if (parsed != null) {
char[] javaPattern = parsed.getJavaPattern().tochararray();
this.regex = new Regex(javaPattern,e2.getMessage());
}
}
项目:nashorn-backport
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
项目:nashorn
文件:JoniRegExp.java
/**
* Construct a Regular expression from the given {@code pattern} and {@code flags} strings.
*
* @param pattern RegExp pattern string
* @param flags RegExp flag string
* @throws ParserException if flags is invalid or pattern string has Syntax error.
*/
public JoniRegExp(final String pattern,e2.getMessage());
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。