ok i have a regex with a numeric range and a prefix, like "node1: 0-10" s/^.*\([0-9]*\)-\([0-9]*\)/\2/ works but \1 doesnt why the fuck
-
-
Replying to @sigfig
try + instead of * in the first one? greedy regex, .* matches 0 inclusively
1 reply 0 retweets 0 likes -
Replying to @apilosov
no + doesn't work because the .* actually matches everything until the next literal match, which is -
1 reply 0 retweets 0 likes -
Replying to @sigfig
it'll work, trust me. it's greedy *if* it can match. but if there's a plus, it *cannot* match greedily.
2 replies 0 retweets 0 likes -
* and + are both greedy, by the escaped parens I'm guessing you're using posix basic which doesn't have a lazy qualifier..
4 replies 0 retweets 1 like -
...but it's almost never needed since you can negate a match with ^ inside []
1 reply 0 retweets 0 likes
or you can put a space after the first .* to catch the one there and stop
4:52 PM - 19 Dec 2016
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.