Re:Regular Expressions – Mastering Lookahead and Lookbehind
by arthur5005 on Friday March 16, 2018 @02:27AM
(#16599003)
You’ve got a problem you think regex can solve, now you’ve got 2 problems.
[ Parent
| on HN ]
Re:Regular Expressions – Mastering Lookahead and Lookbehind
by wruza on Friday March 16, 2018 @04:58AM
(#16599428)
I wrote a list of json keys that should be taken from a message and :‘<,’>s/\(\S\+\)\s{0,}/t.\1 = message.\1;\r/g
Hey, did you commit already? Still typing?
Re:Regular Expressions – Mastering Lookahead and Lookbehind
by jessaustin on Friday March 16, 2018 @09:33AM
(#16600488)
It looks like your quote characters might be messed up there? Anyway, to parse json on the command line one should just use jq.
Re:Regular Expressions – Mastering Lookahead and Lookbehind
by wruza on Friday March 16, 2018 @11:04AM
(#16601139)
Single quotes were modified by HN engine, right. It is not a command line (thinking of sed?), it is the middle of a source code in my editor. I have a json-parsed message and t is a target object.
a b foo c
t.a = !!message.a;
t.b = String(message.b);
t.foo = message.foo;
t.c = tonum(message.c);