#Matching stclass EXACTF <.> against ".exe"
---
#Compiling REx "[q]"
-#size 12 nodes Got 100 bytes for offset annotations.
+#size 3 nodes Got 28 bytes for offset annotations.
#first at 1
#Final program:
# 1: EXACT <q>(3)
# 3: END(0)
#anchored "q" at 0 (checking anchored isall) minlen 1
-#Offsets: [12]
+#Offsets: [3]
# 1:1[3] 3:4[0]
#Guessing start of match, REx "[q]" against "q"...
#Found anchored substr "q" at offset 0...
#Guessed: match at offset 0
#%MATCHED%
#Freeing REx: "[q]"
-Got 100 bytes for offset annotations.
-Offsets: [12]
+Got 28 bytes for offset annotations.
+Offsets: [3]
1:1[3] 3:4[0]
%MATCHED%
Freeing REx: "[q]"
}
}
- else if (! LOC) {
- if (invert && prevvalue == '\n' && value == '\n') {
- op = REG_ANY; /* Optimize [^\n] */
+ else if (value == prevvalue) {
+
+ /* Here, the class consists of just a single code point */
+
+ if (invert) {
+ if (! LOC && value == '\n') {
+ op = REG_ANY; /* Optimize [^\n] */
+ }
+ }
+ else if (value < 256 || UTF) {
+
+ /* Optimize a single value into an EXACTish node, but not if it
+ * would require converting the pattern to UTF-8. */
+ op = compute_EXACTish(pRExC_state);
}
- else if (prevvalue == '0' && value == '9') {
- op = (invert) ? NDIGITA : DIGITA;
+ } /* Otherwise is a range */
+ else if (! LOC) { /* locale could vary these */
+ if (prevvalue == '0') {
+ if (value == '9') {
+ op = (invert) ? NDIGITA : DIGITA;
+ }
}
}
ret = reg_node(pRExC_state, op);
+ if (PL_regkind[op] == EXACT) {
+ alloc_maybe_populate_EXACT(pRExC_state, ret, 0, value);
+ }
+
RExC_parse = (char *) cur_parse;
SvREFCNT_dec(listsv);