4 ms·
Would be nice to have a regex for parsing HTML... grabs popcorn
by blauditore 7y ago
Would be nice to have a regex for parsing HTML...
grabs popcorn
- arkh 7y agoWith subroutines and recursive patterns I think you could do something parsing valid HTML. Your sanity won't be left intact tho.
- asicsp 7y agohow about this "match "A B C" where A+B=C"[1] for sanity? [1] http://www.drregex.com/2018/11/how-to-match-b-c-where-abc-beast-reborn.html http://www.drregex.com/2018/11/how-to-match-b-c-where-abc-be...
- geongeorgek 7y agoHaha..careful. someone might take this seriously
- bmn__ 7y agoEasy with a sufficiently powerful engine: https://stackoverflow.com/a/4234491 https://stackoverflow.com/a/4234491 Relies on ?(DEFINE): http://p3rl.org/perlre#(DEFINE) http://p3rl.org/perlre#(DEFINE)
- quickthrower2 7y agoThere is a good comment on that answer: > To sum up: RegEx's are misnamed. I think it's a shame, but it won't change. Compatible 'RegEx' engines are not allowed to reject non-regular languages. They therefore cannot be implemented correctly with only Finte State Machines. The powerful concepts around computational classes do not apply. Use of RegEx's does not ensure O(n) execution time. The advantages of RegEx's are terse syntax and the implied domain of character recognition. To me, this is a slow moving train wreck, impossible to look away, but with horrible consequences unfolding
- chirss 7y agoboom. https://regex101.com/r/PxSY4U/1 https://regex101.com/r/PxSY4U/1 technically it does parse it. :P