what is the value of the following awk expression :⁠—

/(a|b).*z$/

• string
• number
• extended regular expression (e·r·e)

Follow

this is not a poll because the answer is number

· · Web · 1 · 0 · 2

I AM JUST SAYING i did

r=/some regexp/;
match(str, r);

and IT TRIED TO MATCH str AGAINST THE REGEXP /1/ BECAUSE THAT WAS THE VALUE OF r

and anyway this was a really annoying bug to sort out. that is all

@Lady annoying indeed, i would not have guessed that was a number.

but it does give me a good excuse to tell my favorite awk story. Back around the time i met my partner D, i was working on a project translating/rewriting a large codebase from MAINSAIL to C, and had written a bunch of awk code to semi-automate some of it. At one point i left a bunch of printouts at D's place and she mentioned to me "oh you left your awk code here" ... since she's not a programmer type, I was impressed that she recognized awk.

Years later I met Brian Kernighan at a workshop, and when were chatting over coffee, so I told him the story, and flamboyantly ended it with "and that's when I knew she was the one!" In response ... he looked it me like I had two heads and said something like "that's nice." How embarrassing.

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.