go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think the first debug trick is always avoid debug, i.e. write correct code :). And to write correct RE a good trick is comprehend what are you writing. It also helps to "translate" the specification of how the to be parsed data looks like into a language that easily maps to regular expressions. A good technique to avoid errors and to code a regex according to specification is to build up the regex from strings stored in variables, which you then interpolate into the regex. This also makes the regex much more readable for others. Re: Trying to avoid line noise (brain cramp) gives an example.
Christian Lemburg In reply to Re: Debugging regular expressions
by clemburg
|
|