4 ms·
I don't know why you're getting so mad. I stand by my original comment too a substitute command defines a CLASS of regexes. Output of any machine is arbitrary i
by ethanwillis 4y ago
I don't know why you're getting so mad. I stand by my original comment too a substitute command defines a CLASS of regexes. Output of any machine is arbitrary in its interpretation. Step back and think about how any of these machines are implemented physically and how we get "output" or "transforms" or "extracts."
That is for any given input the substitute turing machine produces a definitive regex.
A subset of regexes (that OP showed) from the total class of regexes that I mentioned in my comment are:
/[Aa]re\s[Yy]ou\s\(.*\)?/Indeed, I am sentient./
/[Aa]re\s[Yy]ou\s\(.*\)?/Indeed, I am capable of intelligence./
/[Aa]re\s[Yy]ou\s\(.\*\)?/Indeed, I am going to take over the world./
Not sure why this is so controversial ;)
- svnpenn 4y agoNope. Regex are patterns, that can be compiled in order to extract or replace text. Commands like (s) have been built on top of and using regex. However, you cant just paste some random S command, and say "Hur dur this is regex" , unless you are just trying to look dumb.
- ethanwillis 4y agoI'm sorry, but I don't think you're understanding. Either because you're embarrassed or there's something else going on. Please set aside your ego if that's the problem because I never said the substitute function is a regex.
- svnpenn 4y agohttps://news.ycombinator.com/item?id=31804367 https://news.ycombinator.com/item?id=31804367
- ethanwillis 4y agoDo you not know what the word class means in this context?
- svnpenn 4y agoIf "a class of" means "a subsection of" (replace "subsection" with whatever word you feel is semantically correct), then your comment is wrong. A substitute command is just that, a command. It is not, and never has been a regex, or any part of it. Heres some headings to help you understand: ## Parts of regex . [a-z] $ ## items that use regex m// s/// qr//
- ethanwillis 4y agoThat's not what it means at all, please read more closely and get it together. You won't learn much by reacting this poorly to things you don't understand. Remember when I said A subset of regexes (that OP showed) from the total class of regexes that I mentioned in my comment are: This clearly implies that a "subset" or "subsection" is not the same as a class. I well defined in multiple ways what I meant by class while you continue to bury your head in the sand.
- svnpenn 4y agoIt seems you fail to understand what class means. Regardless of what you think it means, you're using it wrong. The command given in the example is: - not a regex - not a class of regex - not a part of regex in general please educate yourself, as you seem to have trouble understanding the scope of what regex is.
- ethanwillis 4y agoEducate me on what you think a class is then? Because I think you're conflating it with a set, which it is not.
- svnpenn 4y agothe example given was a command, not a regex, and not a class of regex would you call an apple, a class of an orange?