@novalis
also I have a pretty clear model of how to "be the computer" for a python program, but for a regex it's harder because actually to match an NFA you have to maintain multiple possibilities in your head at the same time or something? Maintaining 3 parallel possibilities for where in the state machine we could be actually doesn't feel that easy.
running a DFA computer in your head is pretty easy but I don't think anyone is really converting a regex to a DFA in their head
@novalis (when I say "maintaining many parallel possibilites at a time", I'm thinking of this "Implementation: Simulating the NFA" section from https://swtch.com/~rsc/regexp/regexp1.html where he simulates an NFA using an array of states)
@novalis yeah I have some of the same thoughts since my thoughts about regexes were also formed in theory of computation class
some things I find weird:
- "a regex defines a regular language" doesn't exactly map to regexes in practice (the '?' feels a little slippery to me, and in fact I get a little confused about ?s in my regexes)
- the thing where matching regexes with backreferences is NP-hard (I never use backreferences because they confuse me, but is it bad to use backreferences?)
@novalis
also I have a pretty clear model of how to "be the computer" for a python program, but for a regex it's harder because actually to match an NFA you have to maintain multiple possibilities in your head at the same time or something? Maintaining 3 parallel possibilities for where in the state machine we could be actually doesn't feel that easy.
running a DFA computer in your head is pretty easy but I don't think anyone is really converting a regex to a DFA in their head
@novalis yeah I have some of the same thoughts since my thoughts about regexes were also formed in theory of computation class
some things I find weird:
- "a regex defines a regular language" doesn't exactly map to regexes in practice (the '?' feels a little slippery to me, and in fact I get a little confused about ?s in my regexes)
- the thing where matching regexes with backreferences is NP-hard (I never use backreferences because they confuse me, but is it bad to use backreferences?)
@b2f27659 i was surprised by all the replies about firewalls because somehow I forgot that people use iptables to configure firewalls :) (I've mostly used it for NAT and weird container stuff)
Notes by Julia Evans | export