Updated references to constants

This commit is contained in:
2025-01-30 10:47:01 -05:00
parent 2e3450285c
commit a63426d965
2 changed files with 9 additions and 9 deletions

View File

@@ -99,13 +99,13 @@ func range2regex(start int, end int) (string, error) {
// Last range - tmp to rangeEnd
ranges = append(ranges, numRange{tmp, rangeEnd})
regex := string(NONCAPLPAREN_CHAR)
regex := string(nonCapLparenRune)
// Generate the regex
for i, rg := range ranges {
if i > 0 {
regex += "|"
}
regex += string(NONCAPLPAREN_CHAR)
regex += string(nonCapLparenRune)
startSlc := intToSlc(rg.start)
endSlc := intToSlc(rg.end)
if len(startSlc) != len(endSlc) {
@@ -115,7 +115,7 @@ func range2regex(start int, end int) (string, error) {
if startSlc[i] == endSlc[i] {
regex += string(rune(startSlc[i] + 48)) // '0' is ascii value 48, 1 is 49 etc. To convert the digit to its character form, we can just add 48.
} else {
regex += fmt.Sprintf("%c%c-%c%c", LBRACKET, rune(startSlc[i]+48), rune(endSlc[i]+48), RBRACKET)
regex += fmt.Sprintf("%c%c-%c%c", lbracketRune, rune(startSlc[i]+48), rune(endSlc[i]+48), RBRACKET)
}
}
regex += ")"