Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Code challenges that involve the use of regular expressions.
2
votes
Regex - Match half of the strings
24
You didn't ask for a max length.
So an infinity of strings can exist.
Half of infinity = infinity.
But that doesn't lead anywhere.
Anyway, I'd say that "half of this infinite number of strings …
11
votes
Accepted
Regex - Match half of the strings
6
/^[5-Z]/
In ASCII's order, there's 0-9 then A-Z then a-z
So Half of the string begin with 5-Z, the other half doesn't.
20
votes
Shortest unmatchable regular expression
4 chars
/$a/
searches a "a" after the end of the string.
or
/a^/
searches a before the beginning of the string.
65
votes
23
answers
15k
views
Shortest unmatchable regular expression
Your mission is to write the shortest valid regular expression that no string can match, empty string included.
Submissions must have this form ("literal notation"):
/pattern/optional-flags
Shorte …
-2
votes
Remove single line and multiline comments from string
JS (ES6), 47 chars (wip)
DEMO: http://codepen.io/anon/pen/dPEMro
a=b=>b.replace(/(\/\*[^]*?\*\/|\/\/.*)\n?/g,"")
Inspired by my codegolfed minifiers: http://xem.github.io/miniMinifier/
doesn't ha …