pmjv@lemmy.sdf.org to linuxmemes@lemmy.world · 8 months agoParsing HTML with regexlemmy.sdf.orgimagemessage-square40fedilinkarrow-up1333arrow-down114file-text
arrow-up1319arrow-down1imageParsing HTML with regexlemmy.sdf.orgpmjv@lemmy.sdf.org to linuxmemes@lemmy.world · 8 months agomessage-square40fedilinkfile-text
minus-squareBlue_Morpho@lemmy.worldlinkfedilinkarrow-up1arrow-down6·edit-28 months ago None of these examples are for parsing English sentences. Read it again: “At one point while working on the manuscript for this book. I ran such a tool on what I’d written so far” The author explicitly stated that he used regex to parse his own book for errors! The example was using regex to parse html. You can’t even write a regex to just consume <div> repeated exactly n times followed by </div> repeated exactly n times, Just because regex can’t do everything in all cases doesn’t mean it isn’t useful to parse some html and English text. It’s like screaming, “You can’t build an Operating system with C because it doesn’t solve the halting problem!”
Read it again:
“At one point while working on the manuscript for this book. I ran such a tool on what I’d written so far”
The author explicitly stated that he used regex to parse his own book for errors! The example was using regex to parse html.
Just because regex can’t do everything in all cases doesn’t mean it isn’t useful to parse some html and English text.
It’s like screaming, “You can’t build an Operating system with C because it doesn’t solve the halting problem!”