prettify.parser
Class CombinePrefixPattern
java.lang.Object
prettify.parser.CombinePrefixPattern
public class CombinePrefixPattern
- extends java.lang.Object
This is similar to the combinePrefixPattern.js in JavaScript Prettify.
All comments are adapted from the JavaScript Prettify.
- Author:
- mikesamuel@gmail.com
|
Method Summary |
protected java.lang.String |
allowAnywhereFoldCaseAndRenumberGroups(java.util.regex.Pattern regex)
|
protected static java.lang.String |
caseFoldCharset(java.lang.String charSet)
|
java.util.regex.Pattern |
combinePrefixPattern(java.util.List<java.util.regex.Pattern> regexs)
Given a group of Patterns, returns a RegExp that globally
matches the union of the sets of strings matched by the input RegExp. |
protected static int |
decodeEscape(java.lang.String charsetPart)
|
protected static java.lang.String |
encodeEscape(int charCode)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
capturedGroupIndex
protected int capturedGroupIndex
needToFoldCase
protected boolean needToFoldCase
escapeCharToCodeUnit
protected static final java.util.Map<java.lang.Character,java.lang.Integer> escapeCharToCodeUnit
CombinePrefixPattern
public CombinePrefixPattern()
combinePrefixPattern
public java.util.regex.Pattern combinePrefixPattern(java.util.List<java.util.regex.Pattern> regexs)
throws java.lang.Exception
- Given a group of
Patterns, returns a RegExp that globally
matches the union of the sets of strings matched by the input RegExp.
Since it matches globally, if the input strings have a start-of-input
anchor (/^.../), it is ignored for the purposes of unioning.
- Parameters:
regexs - non multiline, non-global regexs.
- Returns:
- Pattern a global regex.
- Throws:
java.lang.Exception
decodeEscape
protected static int decodeEscape(java.lang.String charsetPart)
encodeEscape
protected static java.lang.String encodeEscape(int charCode)
caseFoldCharset
protected static java.lang.String caseFoldCharset(java.lang.String charSet)
allowAnywhereFoldCaseAndRenumberGroups
protected java.lang.String allowAnywhereFoldCaseAndRenumberGroups(java.util.regex.Pattern regex)