|
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+\=)))
|
|
|
|
|
Close, but not right yet.
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
|
|
|
|
|
Got it, a more general expression here:
(\w+(?=\=))|((?<!\\)(?<=\=)(.+?)((?=(\s\w+\=))|$))
|
|
|
|
|
This is why regex's should be banned from code bases that require maintenance.
OK in a search/replace context (editor's etc.), but surely we can come up with something better for actually code.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Text deserialization is a PITA - The code for that is not really easier to maintain.
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
|
|
|
|
|
"Spare raven."(8,7)
Caution, this is one of the hardest I have ever done!
Major Kudos if you get it.
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
|
Well Bloody Done!
Tell the nice ladies and gentlemen how you got it!
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
Raven means cowardly hence raven is headless chicken: Spare going raven.
|
|
|
|
|
Not quite:
CRAVEN means cowardly: "headless" means remove the leading letter.
And "headless chicken" means running round, similar to "going spare".
So: "SPARE" - Headless chicken - "(c)RAVEN"
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 – ∞)
|
|
|
|
|
Could you please just stop decapitating those poor chicken ?
~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.
|
|
|
|
|
Us rufty-tufty bikers bite their heads off, not decapitate them!
Herself and I were in a pub having lunch some years ago, and three old ladies were snooping on our conversation from the next table. So I just reminded her that we had to pick up some chickens on the way home for the boys to bite the heads off, or they'd get all stroppy again.
Never seen people change tables so fast!
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 – ∞)
|
|
|
|
|
Close enough, eh? +5 for my solution?
|
|
|
|
|
Already done...
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 – ∞)
|
|
|
|
|
|
Very well done!
You should include the solution for full kudos...it helps those that haven't got it yet understand why the answer is "HEADLESS CHICKEN"
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 – ∞)
|
|
|
|