Skip to content

Commit f52416c

Browse files
committed
Use literal regex
1 parent a60dc20 commit f52416c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/languages/go.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,23 @@ export default function(hljs) {
109109
className: 'number',
110110
variants: [
111111
{
112-
match: '-?\\b0[xX]\\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\\d(_?\\d)*i?', // hex without a present digit before . (making a digit afterwards required)
112+
match: /-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/, // hex without a present digit before . (making a digit afterwards required)
113113
relevance: 0
114114
},
115115
{
116-
match: '-?\\b0[xX](_?[a-fA-F0-9])+((\\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\\d(_?\\d)*)?i?', // hex with a present digit before . (making a digit afterwards optional)
116+
match: /-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/, // hex with a present digit before . (making a digit afterwards optional)
117117
relevance: 0
118118
},
119119
{
120-
match: '-?\\b0[oO](_?[0-7])*i?', // leading 0o octal
120+
match: /-?\b0[oO](_?[0-7])*i?/, // leading 0o octal
121121
relevance: 0
122122
},
123123
{
124-
match: '-?\\.\\d(_?\\d)*([eE][+-]?\\d(_?\\d)*)?i?', // decimal without a present digit before . (making a digit afterwards required)
124+
match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/, // decimal without a present digit before . (making a digit afterwards required)
125125
relevance: 0
126126
},
127127
{
128-
match: '-?\\b\\d(_?\\d)*(\\.(\\d(_?\\d)*)?)?([eE][+-]?\\d(_?\\d)*)?i?', // decimal with a present digit before . (making a digit afterwards optional)
128+
match: /-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/, // decimal with a present digit before . (making a digit afterwards optional)
129129
relevance: 0
130130
}
131131
]

0 commit comments

Comments
 (0)