MCPcopy Create free account
hub / github.com/google/re2j / unhex

Method unhex

java/com/google/re2j/Utils.java:22–33  ·  view source on GitHub ↗
(int c)

Source from the content-addressed store, hash-verified

20
21 // If |c| is an ASCII hex digit, returns its value, otherwise -1.
22 static int unhex(int c) {
23 if ('0' <= c && c <= '9') {
24 return c - '0';
25 }
26 if ('a' <= c && c <= 'f') {
27 return c - 'a' + 10;
28 }
29 if ('A' <= c && c <= 'F') {
30 return c - 'A' + 10;
31 }
32 return -1;
33 }
34
35 private static final String METACHARACTERS = "\\.+*?()|[]{}^$";
36

Callers 2

unquoteCharMethod · 0.95
parseEscapeMethod · 0.95

Calls

no outgoing calls

Tested by 1

unquoteCharMethod · 0.76