#380 RequiredRegexp only handles one line

release_3.5
closed
nobody
usage (27)
5
2012-10-10
2005-10-16
sjq
No

RequiredRegexp does not work with a regular expression
that spans multiple lines. This limitation is not clear
from the documentation. Regular expressions have no
problem working over multiple lines, so why would
anyone expect RequiredRegexp to have this limit.
There is a patch available that implements a new check,
RequiredMultiLineRegexp, that works as you would
expect.I'd like to suggest the RequiredMultiLineRegexp
code replace the existing RequiredRegexp code, so we
have a RequiredRegexp check that works for one or more
lines.
If you make the above change I think you can also get
rid of RegexpHeader. It seems redundant when all that
is needed is to precede your regular expression with
^^, so it only matches at the beginning of the file.

Discussion

  • Lars Kühne
    Lars Kühne
    2005-10-21

    Logged In: YES
    user_id=401384

    This is not a bug but a feature request, RequiredRegexp
    behaves exactly as originally designed and documented.
    Closing this issue as a duplicate of RFE #1032638. Your
    additional thoughts have been recorded in that tracker entry.