cm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agowhat debugging regex feels likelemmy.mlimagemessage-square68fedilinkarrow-up1851arrow-down115cross-posted to: [email protected]
arrow-up1836arrow-down1imagewhat debugging regex feels likelemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agomessage-square68fedilinkcross-posted to: [email protected]
minus-squaremarcos@lemmy.worldlinkfedilinkarrow-up17·2 days agoIf they are Perl regexes, like all regexes are supposed to be, you can have non-semantic whitespace and comments. But if you are using some system that enforces something different, you are out of luck.
minus-squarefrezik@midwest.sociallinkfedilinkarrow-up6·2 days agoNot necessarily. For just debugging purposes, you can still break them up to help understand them. Even ignoring that, there are options in languages that don’t implement /x. https://wumpus-cave.net/post/2022/06/2022-06-06-how-to-write-regexes-that-are-almost-readable/index.html
If they are Perl regexes, like all regexes are supposed to be, you can have non-semantic whitespace and comments.
But if you are using some system that enforces something different, you are out of luck.
Not necessarily. For just debugging purposes, you can still break them up to help understand them. Even ignoring that, there are options in languages that don’t implement /x.
https://wumpus-cave.net/post/2022/06/2022-06-06-how-to-write-regexes-that-are-almost-readable/index.html