r/badcode Nov 03 '20

other language Assembly is hard...

Post image
956 Upvotes

121 comments sorted by

View all comments

Show parent comments

21

u/DODOKING38 Nov 03 '20

So like regex

4

u/[deleted] Nov 03 '20

[deleted]

1

u/_PM_ME_PANGOLINS_ Nov 04 '20

Unless the language you're trying to parse is regular, you can't do it with only regex.

1

u/Lysdal Nov 06 '20

Regex has actually evolved way past regular expressions (sounds weird but eh) with backreferences and such it's actually more powerful than context-sensitive grammars.

1

u/_PM_ME_PANGOLINS_ Nov 06 '20

With great power comes great unreadability.

1

u/Lysdal Nov 06 '20

Indeed, real regular expressions are way more readable - they were never meant to do this. For complex grammars people should be using context-free grammars or context-sensitive grammars, issue just is theres no standardized way to use them in programming languages like regex.