Replace [\w\W] with [\s\S] and [0-9] with \d in regexes (#1107) * Replace [\w\W] with [^] and [0-9] with \d in regexes * Replace [\s\S] with [^] * Replace [^] with [\s\S]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
diff --git a/components/prism-actionscript.js b/components/prism-actionscript.js
index ff5804d..6984531 100644
--- a/components/prism-actionscript.js
+++ b/components/prism-actionscript.js
@@ -7,7 +7,7 @@ Prism.languages.actionscript['class-name'].alias = 'function';
if (Prism.languages.markup) {
Prism.languages.insertBefore('actionscript', 'string', {
'xml': {
- pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,
+ pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\s\S])*\2)*\s*\/?>/,
lookbehind: true,
inside: {
rest: Prism.languages.markup
diff --git a/components/prism-ada.js b/components/prism-ada.js
index 95ca462..68bca4f 100644
--- a/components/prism-ada.js
+++ b/components/prism-ada.js
@@ -3,10 +3,10 @@ Prism.languages.ada = {
'string': /"(?:""|[^"\r\f\n])*"/i,
'number': [
{
- pattern: /\b[0-9](?:_?[0-9])*#[0-9A-F](?:_?[0-9A-F])*(?:\.[0-9A-F](?:_?[0-9A-F])*)?#(?:E[+-]?[0-9](?:_?[0-9])*)?/i
+ pattern: /\b\d(?:_?\d)*#[0-9A-F](?:_?[0-9A-F])*(?:\.[0-9A-F](?:_?[0-9A-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i
},
{
- pattern: /\b[0-9](?:_?[0-9])*(?:\.[0-9](?:_?[0-9])*)?(?:E[+-]?[0-9](?:_?[0-9])*)?\b/i
+ pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i
}
],
'attr-name': /\b'\w+/i,
diff --git a/components/prism-applescript.js b/components/prism-applescript.js
index 52d0aee..138a619 100644
--- a/components/prism-applescript.js
+++ b/components/prism-applescript.js
@@ -1,7 +1,7 @@
Prism.languages.applescript = {
'comment': [
// Allow one level of nesting
- /\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,
+ /\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/,
/--.+/,
/#.+/
],
diff --git a/components/prism-aspnet.js b/components/prism-aspnet.js
index 9511e45..692acc0 100644
--- a/components/prism-aspnet.js
+++ b/components/prism-aspnet.js
@@ -15,7 +15,7 @@ Prism.languages.aspnet = Prism.languages.extend('markup', {
}
});
// Regexp copied from prism-markup, with a negative look-ahead added
-Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i;
+Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i;
// match directives of attribute value foo="<% Bar %>"
Prism.languages.insertBefore('inside', 'punctuation', {
@@ -23,13 +23,13 @@ Prism.languages.insertBefore('inside', 'punctuation', {
}, Prism.languages.aspnet.tag.inside["attr-value"]);
Prism.languages.insertBefore('aspnet', 'comment', {
- 'asp comment': /<%--[\w\W]*?--%>/
+ 'asp comment': /<%--[\s\S]*?--%>/
});
// script runat="server" contains csharp, not javascript
Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', {
'asp script': {
- pattern: /(<script(?=.*runat=['"]?server['"]?)[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,
+ pattern: /(<script(?=.*runat=['"]?server['"]?)[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,
lookbehind: true,
inside: Prism.languages.csharp || {}
}
diff --git a/components/prism-bash.js b/components/prism-bash.js
index d8800dc..8b8a2f0 100644
--- a/components/prism-bash.js
+++ b/components/prism-bash.js
@@ -3,11 +3,11 @@
variable: [
// Arithmetic Environment
{
- pattern: /\$?\(\([\w\W]+?\)\)/,
+ pattern: /\$?\(\([\s\S]+?\)\)/,
inside: {
// If there is a $ sign at the beginning highlight $(( and )) as variable
variable: [{
- pattern: /(^\$\(\([\w\W]+)\)\)/,
+ pattern: /(^\$\(\([\s\S]+)\)\)/,
lookbehind: true
},
/^\$\(\(/,
diff --git a/components/prism-clike.js b/components/prism-clike.js
index c691011..9843e2c 100644
--- a/components/prism-clike.js
+++ b/components/prism-clike.js
@@ -1,7 +1,7 @@
Prism.languages.clike = {
'comment': [
{
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true
},
{
diff --git a/components/prism-crystal.js b/components/prism-crystal.js
index fd6fad0..77bc34e 100644
--- a/components/prism-crystal.js
+++ b/components/prism-crystal.js
@@ -8,7 +8,7 @@
}
],
- number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
+ number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:\d(?:[0-9_]*\d)?)(?:\.[0-9_]*\d)?(?:[eE][+-]?[0-9_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
});
var rest = Prism.util.clone(Prism.languages.crystal);
diff --git a/components/prism-css.js b/components/prism-css.js
index 171c988..7d220d3 100644
--- a/components/prism-css.js
+++ b/components/prism-css.js
@@ -1,5 +1,5 @@
Prism.languages.css = {
- 'comment': /\/\*[\w\W]*?\*\//,
+ 'comment': /\/\*[\s\S]*?\*\//,
'atrule': {
pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
inside: {
@@ -7,10 +7,10 @@ Prism.languages.css = {
// See rest below
}
},
- 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
+ 'url': /url\((?:(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
'string': {
- pattern: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
+ pattern: /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'property': /(\b|\B)[\w-]+(?=\s*:)/i,
@@ -24,7 +24,7 @@ Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
'style': {
- pattern: /(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,
+ pattern: /(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,
lookbehind: true,
inside: Prism.languages.css,
alias: 'language-css'
diff --git a/components/prism-d.js b/components/prism-d.js
index 347eb08..e6cf742 100644
--- a/components/prism-d.js
+++ b/components/prism-d.js
@@ -38,7 +38,7 @@ Prism.languages.d.comment = [
// /+ +/
{
// Allow one level of nesting
- pattern: /(^|[^\\])\/\+(?:\/\+[\w\W]*?\+\/|[\w\W])*?\+\//,
+ pattern: /(^|[^\\])\/\+(?:\/\+[\s\S]*?\+\/|[\s\S])*?\+\//,
lookbehind: true
}
].concat(Prism.languages.d.comment);
diff --git a/components/prism-django.js b/components/prism-django.js
index 49d39f6..63a2e52 100644
--- a/components/prism-django.js
+++ b/components/prism-django.js
@@ -3,7 +3,7 @@
var _django_template = {
'property': {
- pattern: /(?:{{|{%)[\w\W]*?(?:%}|}})/g,
+ pattern: /(?:{{|{%)[\s\S]*?(?:%}|}})/g,
greedy: true,
inside: {
'string': {
@@ -20,9 +20,9 @@ var _django_template = {
}
};
-Prism.languages.django = Prism.languages.extend('markup', {'comment': /(?:<!--|{#)[\w\W]*?(?:#}|-->)/});
+Prism.languages.django = Prism.languages.extend('markup', {'comment': /(?:<!--|{#)[\s\S]*?(?:#}|-->)/});
// Updated html tag pattern to allow template tags inside html tags
-Prism.languages.django.tag.pattern = /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^>=]+))?)*\s*\/?>/i;
+Prism.languages.django.tag.pattern = /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^>=]+))?)*\s*\/?>/i;
Prism.languages.insertBefore('django', 'entity', _django_template);
Prism.languages.insertBefore('inside', 'tag', _django_template, Prism.languages.django.tag);
diff --git a/components/prism-fsharp.js b/components/prism-fsharp.js
index f764576..7b5dc18 100644
--- a/components/prism-fsharp.js
+++ b/components/prism-fsharp.js
@@ -1,7 +1,7 @@
Prism.languages.fsharp = Prism.languages.extend('clike', {
'comment': [
{
- pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/,
+ pattern: /(^|[^\\])\(\*[\s\S]*?\*\)/,
lookbehind: true
},
{
diff --git a/components/prism-glsl.js b/components/prism-glsl.js
index e9cbfac..9afcfe9 100644
--- a/components/prism-glsl.js
+++ b/components/prism-glsl.js
@@ -1,6 +1,6 @@
Prism.languages.glsl = Prism.languages.extend('clike', {
'comment': [
- /\/\*[\w\W]*?\*\//,
+ /\/\*[\s\S]*?\*\//,
/\/\/(?:\\(?:\r\n|[\s\S])|.)*/
],
'number': /\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i,
diff --git a/components/prism-groovy.js b/components/prism-groovy.js
index c6f749e..fcb7bfd 100644
--- a/components/prism-groovy.js
+++ b/components/prism-groovy.js
@@ -2,7 +2,7 @@ Prism.languages.groovy = Prism.languages.extend('clike', {
'keyword': /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,
'string': [
{
- pattern: /("""|''')[\W\w]*?\1|(\$\/)(\$\/\$|[\W\w])*?\/\$/,
+ pattern: /("""|''')[\s\S]*?\1|(\$\/)(\$\/\$|[\s\S])*?\/\$/,
greedy: true
},
{
diff --git a/components/prism-handlebars.js b/components/prism-handlebars.js
index d6eb8e9..72b6d14 100644
--- a/components/prism-handlebars.js
+++ b/components/prism-handlebars.js
@@ -1,6 +1,6 @@
(function(Prism) {
- var handlebars_pattern = /\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;
+ var handlebars_pattern = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;
Prism.languages.handlebars = Prism.languages.extend('markup', {
'handlebars': {
@@ -22,7 +22,7 @@
pattern: /\[[^\]]+\]/,
inside: {
punctuation: /\[|\]/,
- variable: /[\w\W]+/
+ variable: /[\s\S]+/
}
},
'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,
@@ -35,7 +35,7 @@
// surround markup
Prism.languages.insertBefore('handlebars', 'tag', {
'handlebars-comment': {
- pattern: /\{\{![\w\W]*?\}\}/,
+ pattern: /\{\{![\s\S]*?\}\}/,
alias: ['handlebars','comment']
}
});
diff --git a/components/prism-haskell.js b/components/prism-haskell.js
index 043b763..9c4720a 100644
--- a/components/prism-haskell.js
+++ b/components/prism-haskell.js
@@ -1,6 +1,6 @@
Prism.languages.haskell= {
'comment': {
- pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m,
+ pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\s\S]*?-})/m,
lookbehind: true
},
'char': /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,
diff --git a/components/prism-http.js b/components/prism-http.js
index edddb40..db03da6 100644
--- a/components/prism-http.js
+++ b/components/prism-http.js
@@ -9,11 +9,11 @@ Prism.languages.http = {
}
},
'response-status': {
- pattern: /^HTTP\/1.[01] [0-9]+.*/m,
+ pattern: /^HTTP\/1.[01] \d+.*/m,
inside: {
// Status, e.g. 200 OK
property: {
- pattern: /(^HTTP\/1.[01] )[0-9]+.*/i,
+ pattern: /(^HTTP\/1.[01] )\d+.*/i,
lookbehind: true
}
}
diff --git a/components/prism-javascript.js b/components/prism-javascript.js
index 27cdf84..7d17a58 100644
--- a/components/prism-javascript.js
+++ b/components/prism-javascript.js
@@ -37,7 +37,7 @@ Prism.languages.insertBefore('javascript', 'string', {
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
'script': {
- pattern: /(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,
+ pattern: /(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,
lookbehind: true,
inside: Prism.languages.javascript,
alias: 'language-javascript'
diff --git a/components/prism-jsx.js b/components/prism-jsx.js
index 0dd81bb..b668e26 100644
--- a/components/prism-jsx.js
+++ b/components/prism-jsx.js
@@ -3,9 +3,9 @@
var javascript = Prism.util.clone(Prism.languages.javascript);
Prism.languages.jsx = Prism.languages.extend('markup', javascript);
-Prism.languages.jsx.tag.pattern= /<\/?[\w\.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?|\{\.{3}\w+\})\s*)*\/?>/i;
+Prism.languages.jsx.tag.pattern= /<\/?[\w\.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(\\?[\s\S])*?\1|[^\s'">=]+|(\{[\s\S]*?\})))?|\{\.{3}\w+\})\s*)*\/?>/i;
-Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:('|")[\w\W]*?(\1)|[^\s>]+)/i;
+Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:('|")[\s\S]*?(\1)|[^\s>]+)/i;
Prism.languages.insertBefore('inside', 'attr-name', {
'spread': {
diff --git a/components/prism-latex.js b/components/prism-latex.js
index d736ead..7c32f1f 100644
--- a/components/prism-latex.js
+++ b/components/prism-latex.js
@@ -11,7 +11,7 @@
'comment': /%.*/m,
// the verbatim environment prints whitespace to the document
'cdata': {
- pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})([\w\W]*?)(?=\\end\{\2\})/,
+ pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})([\s\S]*?)(?=\\end\{\2\})/,
lookbehind: true
},
/*
@@ -20,12 +20,12 @@
*/
'equation': [
{
- pattern: /\$(?:\\?[\w\W])*?\$|\\\((?:\\?[\w\W])*?\\\)|\\\[(?:\\?[\w\W])*?\\\]/,
+ pattern: /\$(?:\\?[\s\S])*?\$|\\\((?:\\?[\s\S])*?\\\)|\\\[(?:\\?[\s\S])*?\\\]/,
inside: insideEqu,
alias: 'string'
},
{
- pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})([\w\W]*?)(?=\\end\{\2\})/,
+ pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})([\s\S]*?)(?=\\end\{\2\})/,
lookbehind: true,
inside: insideEqu,
alias: 'string'
diff --git a/components/prism-less.js b/components/prism-less.js
index 712488a..4f3a3d5 100644
--- a/components/prism-less.js
+++ b/components/prism-less.js
@@ -8,7 +8,7 @@
Prism.languages.less = Prism.languages.extend('css', {
'comment': [
- /\/\*[\w\W]*?\*\//,
+ /\/\*[\s\S]*?\*\//,
{
pattern: /(^|[^\\])\/\/.*/,
lookbehind: true
diff --git a/components/prism-livescript.js b/components/prism-livescript.js
index 97bee4a..7a26605 100644
--- a/components/prism-livescript.js
+++ b/components/prism-livescript.js
@@ -23,7 +23,7 @@ Prism.languages.livescript = {
},
'comment': [
{
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true,
greedy: true
},
diff --git a/components/prism-markup.js b/components/prism-markup.js
index 73fe302..e7a65ba 100644
--- a/components/prism-markup.js
+++ b/components/prism-markup.js
@@ -1,10 +1,10 @@
Prism.languages.markup = {
- 'comment': /<!--[\w\W]*?-->/,
- 'prolog': /<\?[\w\W]+?\?>/,
- 'doctype': /<!DOCTYPE[\w\W]+?>/i,
- 'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
+ 'comment': /<!--[\s\S]*?-->/,
+ 'prolog': /<\?[\s\S]+?\?>/,
+ 'doctype': /<!DOCTYPE[\s\S]+?>/i,
+ 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
'tag': {
- pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
+ pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i,
inside: {
'tag': {
pattern: /^<\/?[^\s>\/]+/i,
@@ -14,7 +14,7 @@ Prism.languages.markup = {
}
},
'attr-value': {
- pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
+ pattern: /=(?:('|")[\s\S]*?(\1)|[^\s>]+)/i,
inside: {
'punctuation': /[=>"']/
}
diff --git a/components/prism-nsis.js b/components/prism-nsis.js
index 7858b34..4c34548 100644
--- a/components/prism-nsis.js
+++ b/components/prism-nsis.js
@@ -5,7 +5,7 @@
*/
Prism.languages.nsis = {
'comment': {
- pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|[#;].*)/,
+ pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|[#;].*)/,
lookbehind: true
},
'string': {
diff --git a/components/prism-php.js b/components/prism-php.js
index 0e7c895..b135fbf 100644
--- a/components/prism-php.js
+++ b/components/prism-php.js
@@ -15,7 +15,7 @@ Prism.languages.php = Prism.languages.extend('clike', {
'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,
'constant': /\b[A-Z0-9_]{2,}\b/,
'comment': {
- pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
lookbehind: true,
greedy: true
}
@@ -64,7 +64,7 @@ if (Prism.languages.markup) {
env.tokenStack = [];
env.backupCode = env.code;
- env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function(match) {
+ env.code = env.code.replace(/(?:<\?php|<\?)[\s\S]*?(?:\?>)/ig, function(match) {
env.tokenStack.push(match);
return '{{{PHP' + env.tokenStack.length + '}}}';
@@ -96,7 +96,7 @@ if (Prism.languages.markup) {
// Wrap tokens in classes that are missing them
Prism.hooks.add('wrap', function(env) {
if (env.language === 'php' && env.type === 'markup') {
- env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, "<span class=\"token php\">$1</span>");
+ env.content = env.content.replace(/(\{\{\{PHP\d+\}\}\})/g, "<span class=\"token php\">$1</span>");
}
});
@@ -106,6 +106,6 @@ if (Prism.languages.markup) {
pattern: /<[^?]\/?(.*?)>/,
inside: Prism.languages.markup
},
- 'php': /\{\{\{PHP[0-9]+\}\}\}/
+ 'php': /\{\{\{PHP\d+\}\}\}/
});
}
diff --git a/components/prism-powershell.js b/components/prism-powershell.js
index 6c24200..2544889 100644
--- a/components/prism-powershell.js
+++ b/components/prism-powershell.js
@@ -1,7 +1,7 @@
Prism.languages.powershell = {
'comment': [
{
- pattern: /(^|[^`])<#[\w\W]*?#>/,
+ pattern: /(^|[^`])<#[\s\S]*?#>/,
lookbehind: true
},
{
@@ -11,7 +11,7 @@ Prism.languages.powershell = {
],
'string': [
{
- pattern: /"(`?[\w\W])*?"/,
+ pattern: /"(`?[\s\S])*?"/,
greedy: true,
inside: {
'function': {
@@ -27,7 +27,7 @@ Prism.languages.powershell = {
}
],
// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
- 'namespace': /\[[a-z][\w\W]*?\]/i,
+ 'namespace': /\[[a-z][\s\S]*?\]/i,
'boolean': /\$(true|false)\b/i,
'variable': /\$\w+\b/i,
// Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
diff --git a/components/prism-pure.js b/components/prism-pure.js
index cef1660..0af2ae7 100644
--- a/components/prism-pure.js
+++ b/components/prism-pure.js
@@ -16,7 +16,7 @@
},
'comment': [
{
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
greedy: true,
lookbehind: true
},
diff --git a/components/prism-qore.js b/components/prism-qore.js
index 0872fa5..2fe5fa0 100644
--- a/components/prism-qore.js
+++ b/components/prism-qore.js
@@ -1,6 +1,6 @@
Prism.languages.qore = Prism.languages.extend('clike', {
'comment': {
- pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:\/\/|#).*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/,
lookbehind: true
},
// Overridden to allow unescaped multi-line strings
diff --git a/components/prism-reason.js b/components/prism-reason.js
index eb18100..222b750 100644
--- a/components/prism-reason.js
+++ b/components/prism-reason.js
@@ -1,6 +1,6 @@
Prism.languages.reason = Prism.languages.extend('clike', {
'comment': {
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true
},
'string': {
diff --git a/components/prism-rust.js b/components/prism-rust.js
index cacfddd..68d55df 100644
--- a/components/prism-rust.js
+++ b/components/prism-rust.js
@@ -8,7 +8,7 @@
Prism.languages.rust = {
'comment': [
{
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true
},
{
diff --git a/components/prism-scala.js b/components/prism-scala.js
index 29738bb..8839bfd 100644
--- a/components/prism-scala.js
+++ b/components/prism-scala.js
@@ -2,7 +2,7 @@ Prism.languages.scala = Prism.languages.extend('java', {
'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,
'string': [
{
- pattern: /"""[\W\w]*?"""/,
+ pattern: /"""[\s\S]*?"""/,
greedy: true
},
{
diff --git a/components/prism-scheme.js b/components/prism-scheme.js
index e5eade8..487ce34 100644
--- a/components/prism-scheme.js
+++ b/components/prism-scheme.js
@@ -13,7 +13,7 @@ Prism.languages.scheme = {
lookbehind : true
},
'number' : {
- pattern: /(\s|\))[-+]?[0-9]*\.?[0-9]+(?:\s*[-+]\s*[0-9]*\.?[0-9]+i)?\b/,
+ pattern: /(\s|\))[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?\b/,
lookbehind: true
},
'boolean' : /#[tf]/,
diff --git a/components/prism-scss.js b/components/prism-scss.js
index a23c4ae..705c290 100644
--- a/components/prism-scss.js
+++ b/components/prism-scss.js
@@ -1,6 +1,6 @@
Prism.languages.scss = Prism.languages.extend('css', {
'comment': {
- pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
lookbehind: true
},
'atrule': {
diff --git a/components/prism-smarty.js b/components/prism-smarty.js
index c013796..6c7b2e4 100644
--- a/components/prism-smarty.js
+++ b/components/prism-smarty.js
@@ -5,7 +5,7 @@
(function(Prism) {
- var smarty_pattern = /\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g;
+ var smarty_pattern = /\{\*[\s\S]+?\*\}|\{[\s\S]+?\}/g;
var smarty_litteral_start = '{literal}';
var smarty_litteral_end = '{/literal}';
var smarty_litteral_mode = false;
@@ -68,7 +68,7 @@
// surround markup
Prism.languages.insertBefore('smarty', 'tag', {
'smarty-comment': {
- pattern: /\{\*[\w\W]*?\*\}/,
+ pattern: /\{\*[\s\S]*?\*\}/,
alias: ['smarty','comment']
}
});
diff --git a/components/prism-sql.js b/components/prism-sql.js
index 2d8e85c..ad720c8 100644
--- a/components/prism-sql.js
+++ b/components/prism-sql.js
@@ -1,6 +1,6 @@
Prism.languages.sql= {
'comment': {
- pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:--|\/\/|#).*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
lookbehind: true
},
'string' : {
diff --git a/components/prism-stylus.js b/components/prism-stylus.js
index 6fe36f5..8f79f21 100644
--- a/components/prism-stylus.js
+++ b/components/prism-stylus.js
@@ -38,7 +38,7 @@
Prism.languages.stylus = {
'comment': {
- pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*)/,
+ pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|\/\/.*)/,
lookbehind: true
},
'atrule-declaration': {
diff --git a/components/prism-textile.js b/components/prism-textile.js
index 82d8c2a..c1397fa 100644
--- a/components/prism-textile.js
+++ b/components/prism-textile.js
@@ -237,7 +237,7 @@
};
// Only allow alpha-numeric HTML tags, not XML tags
- Prism.languages.textile.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i;
+ Prism.languages.textile.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i;
// Allow some nesting
Prism.languages.textile['phrase'].inside['inline'].inside['bold'].inside = nestedPatterns;
diff --git a/components/prism-verilog.js b/components/prism-verilog.js
index acf5eb0..9565c14 100644
--- a/components/prism-verilog.js
+++ b/components/prism-verilog.js
@@ -1,5 +1,5 @@
Prism.languages.verilog = {
- 'comment': /\/\/.*|\/\*[\w\W]*?\*\//,
+ 'comment': /\/\/.*|\/\*[\s\S]*?\*\//,
'string': {
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
greedy: true
diff --git a/components/prism-wiki.js b/components/prism-wiki.js
index 4a5f128..e047939 100644
--- a/components/prism-wiki.js
+++ b/components/prism-wiki.js
@@ -1,6 +1,6 @@
Prism.languages.wiki = Prism.languages.extend('markup', {
'block-comment': {
- pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
+ pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
lookbehind: true,
alias: 'comment'
},
@@ -70,10 +70,10 @@ Prism.languages.wiki = Prism.languages.extend('markup', {
Prism.languages.insertBefore('wiki', 'tag', {
// Prevent highlighting inside <nowiki>, <source> and <pre> tags
'nowiki': {
- pattern: /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i,
+ pattern: /<(nowiki|pre|source)\b[\s\S]*?>[\s\S]*?<\/\1>/i,
inside: {
'tag': {
- pattern: /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(?:nowiki|pre|source)>/i,
+ pattern: /<(?:nowiki|pre|source)\b[\s\S]*?>|<\/(?:nowiki|pre|source)>/i,
inside: Prism.languages.markup['tag'].inside
}
}