com.gargoylesoftware.htmlunit.javascript.regexp
Class RegExpJsToJavaConverter
java.lang.Object
com.gargoylesoftware.htmlunit.javascript.regexp.RegExpJsToJavaConverter
public class RegExpJsToJavaConverter
- extends Object
Translates JavaScript RegExp to Java RegExp.
// [...\b...] -> [...\cH...]
// [...[...] -> [...\[...]
// [^\\1] -> .
// back reference in character classes are simply ignored by browsers [...ab\5cd...] -> [...abcd...]
// characters escaped without need should be "un-escaped"
Escape curly braces that are not used in an expression
like "{n}", "{n,}" or "{n,m}" (where n and m are positive integers).
- Version:
- $Revision: 8931 $
- Author:
- Ronald Brill
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegExpJsToJavaConverter
public RegExpJsToJavaConverter()
- Initiate the FSM.
convert
public String convert(String input)
- Run the state machine on a given input string.
- Parameters:
input - the js regexp to process
- Returns:
- a valid java regex pattern
Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.