|
This annoys me as well, but to be fair, you don't see a cyclist in the dark (even one with a decent headlight) more than maybe 50-100m away, at which point not dipping has already dazzled them.
I do dip when I see a cyclist but I know (as I cycle as well) that it's probably too late to avoid 90% of the annoyance already.
|
|
|
|
|
Last night I almost totalled a Mod on a scooter[^] - his bike was covered in lights, but none of them were switched on. If it wasn't for the fairly faint glow of some LEDs he had fitted under the chassi, I would not have seen him.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
With that many lights, I suspect if they actually turn them on the scooter won't start.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
RegEx clue of the day.
There is a string formatted like asdf=237462 123 xdec\=123 xdc=12344. The answer to this clue is the RegEx which eventually puts out
asdf
237462 123 xdec\=123
xdc
12344
Hint: ([^\s]*(?key1=234 SDF\=1234 asd=1233 xyz\=asdf supplies
key1
234 SDF\=1234
asd
1233 xyz\=asdf
as output
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
modified 20-Mar-14 6:28am.
|
|
|
|
|
Did you mean?
asdf
237462 123 xdec\=123 xdc
12344
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
No.
The trick is that you have a key-value pair KEY=VALUE, but the value can contain a "=", too (if it is escaped as ("\=").
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
|
|
|
|
|
Well, it's probably cheating, but:
(asdf)(?:\=)(237462\s123\sxdec\\\=123)(?:\s)(xdc)(?:\=)(12344)
will do it...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It is not probably cheating, it is cheating.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Matches the input, supplies the output!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It's probably still cheating, but you can "generalize" my last "solution" to this:
(\w+)(?:\=)([\w\s\\]+\=\w+)(?:\s)(\w+)(?:\=)(\w+) Which also works. It depends what the "important factors" in your input are, and one example isn't really enough...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Looking at your answer my brain just exploded, coffee and screws scattered everywhere. Always knew I had a screw loose, but so many?
Along with Antimatter and Dark Matter they've discovered the existence of Doesn't Matter which appears to have no effect on the universe whatsoever!
Rich Tennant 5th Wave
|
|
|
|
|
One of the things I like about Expresso [^] is that you can tell it to ignore whitespace in the input string, so you can break the input into "phrases" - each on a signle line. If you do that:
(\w+)
(?:\=)
([\w\s\\]+\=\w+)
(?:\s)
(\w+)
(?:\=)
(\w+) It all looks easier:
(\w+) Any alphanumeric, one or more
(?:\=) Match an equals, but ignore it
([\w\s\\]+\=\w+) One or more alphanumeric, whitespace or '\' characters, a single equals sign,
then one or more alphanumeric again
(?:\s) Match whitespace, and ignore it
(\w+) Any alphanumeric, one or more again
(?:\=) Ignore another equals
(\w+) And finally any alphanumeric, one or more
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Awesome thanks, I learned a few things from your explanation I hadn't known.
For what little RegEx I used to do I loved Expresso, it was a life saver in many instances.
Along with Antimatter and Dark Matter they've discovered the existence of Doesn't Matter which appears to have no effect on the universe whatsoever!
Rich Tennant 5th Wave
|
|
|
|
|
Glad to be of help!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I added another example, which blew your solution. Nevertheless, close you are.
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
|
|
|
|
|
Hey don't change the rules in the middle of the game, this is not Calvinball !
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Well if you are going to change the rules!
It's just a replacement of "\w" with "." in the final group:
(\w+)(?:\=)([\w\s\\]+\=\w+)(?:\s)(\w+)(?:\=)(.+)
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
Thanks!
Where do you want the invoice sent?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: Where do you want the invoice sent?
Those who fail to learn history are doomed to repeat it. -
send it to the Nigerian prince who promised to give me a million dollar in return for a 10'000 Dollar pay.
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
|
|
|
|
|
OG's solution is nice but not exactly what you need...
First \w is declared in regex as [a-zA-Z0-9]. Are you sure your key can have numbers in it?
The value part can be anything (dot (.) not \w) but = must be escaped. Here OG is really far from it... (Sorry OG ).
After that can be an some whitespace and again a key-value pair, endlessly...And here the really catch! How do you know you got the next key-value pair? If value can have un-escaped whitespaces?
So - start again OG!!!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
modified 20-Mar-14 8:26am.
|
|
|
|
|
Arrg, this has been bugging me on and off for a whole day. Why does it insist on always choosing the longest string match:
(\w+(?=\=))|((?<!\\)(?<=\=)(.+)((?=(\s\w+\=))))
|
|
|
|
|
Because you haven't told it not to!
Add a '?' after the appropriate '+' or '*' and it'all match the minimum it can.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Ah, that works, why didnt I think of that :facepalm:
|
|
|
|
|
I think im close but not quite:
((([a-zA-Z]|\d)+(?!\x5C)(?=\=))|(?<!\x5C)(?<=\=)(.*)(?=(\s\w+\=)))
|
|
|
|