Skip to content
Permalink
Browse files
Use \d for [0-9] (#3097)
Also `[\d.]` for `[0-9.]` and `[\d_]` for `[0-9_]`.
  • Loading branch information
valtlai committed Oct 5, 2021
1 parent 798ee4f commit 9fe2f93e1f1f722ff226e149d1f218e7fea6a717
@@ -18,10 +18,10 @@ Prism.languages.cil = {

'keyword': /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,

'function': /\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,
'function': /\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.\d+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,

'boolean': /\b(?:false|true)\b/,
'number': /\b-?(?:0x[0-9a-f]+|[0-9]+)(?:\.[0-9a-f]+)?\b/i,
'number': /\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i,

'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/
};

Some generated files are not rendered by default. Learn more.

@@ -1,7 +1,7 @@
(function (Prism) {
Prism.languages.http = {
'request-line': {
pattern: /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,
pattern: /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,
inside: {
// HTTP Method
'method': {
@@ -17,18 +17,18 @@
},
// HTTP Version
'http-version': {
pattern: /^(\s)HTTP\/[0-9.]+/,
pattern: /^(\s)HTTP\/[\d.]+/,
lookbehind: true,
alias: 'property'
},
}
},
'response-status': {
pattern: /^HTTP\/[0-9.]+ \d+ .+/m,
pattern: /^HTTP\/[\d.]+ \d+ .+/m,
inside: {
// HTTP Version
'http-version': {
pattern: /^HTTP\/[0-9.]+/,
pattern: /^HTTP\/[\d.]+/,
alias: 'property'
},
// Status Code

Some generated files are not rendered by default. Learn more.

@@ -37,7 +37,7 @@ Prism.languages.jsstacktrace = {
},

'line-number': {
pattern: /:[0-9]+(?::[0-9]+)?\b/,
pattern: /:\d+(?::\d+)?\b/,
alias: 'number',
inside: {
'punctuation': /:/

Some generated files are not rendered by default. Learn more.

@@ -81,7 +81,7 @@
},
entity: {
// ipv4
pattern: /\b(?:(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\b/,
pattern: /\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/,
greedy: true
}
};

Some generated files are not rendered by default. Learn more.

@@ -30,7 +30,7 @@ Prism.languages.psl = {
'function': {
pattern: /\b[_a-z]\w*\b(?=\s*\()/i,
},
'number': /\b(?:0x[0-9a-f]+|[0-9]+(?:\.[0-9]+)?)\b/i,
'number': /\b(?:0x[0-9a-f]+|\d+(?:\.\d+)?)\b/i,
'operator': /--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,
'punctuation': /[(){}\[\];,]/
};

0 comments on commit 9fe2f93

Please sign in to comment.