Created
June 4, 2014 16:05
-
-
Save Infocatcher/be52ae6a37dcfa4234ae to your computer and use it in GitHub Desktop.
Testcase for JavaScript syntax highlighting (regular expressions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Regular expressions | |
var r = /\//i; | |
var r = /[\/*]/img; | |
var r = /[a-z]{5}/; | |
var r = /[a-z]{1,5}/; | |
var r = /([a-z])+/; | |
var r = /([a-z]{1,5})+/; | |
var r = /f([a-z])/; | |
var r = /a(b)c(d)/; | |
if(/\*/.test(s)); | |
/./.test(s) && f(); | |
/[a-z]/.test(s) && f(); | |
var a = [/a/, /b/]; | |
var o = { r: /./, x: 2 }; | |
var x = a && /b/.test(c); | |
var x = a ? /b/ : /c/; | |
var x = !/a/.test(b); | |
var x = f(/./i); | |
// Not a regular expressions | |
var n = 1/2; | |
var n = 1/2/3; | |
var n = 1/2/i; | |
var n = 1/(2/i); | |
var n = 1/this.n/3; | |
var n = 1/this.n()/3; | |
var n = 1/this.n(2/3); | |
var n = 1/2 + (function() { return 3/4; })(); | |
var n = 1/2*(this.x/3 + 2); | |
var n = 1/2*(this.x + 2/3); | |
var n = f(1/2) + 3/2; | |
var n = f(1/2) + g(3/2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment