Loading ...
Sorry, an error occurred while loading the content.

use of \n in regex? [ was:regex to match paragraph]

Expand Messages
  • msws_1
    ... class. I made it: if ( param( acctinfo ) !~ /^[a-zA-Z0-9 &,# % * ( ) $ - + r n]{0,800} $/ ) { And yes, adding the r seems to have fixed it. I hadn t
    Message 1 of 5 , Apr 30, 2002
      > You've probably got \r's with your \n's. Add \r to the character

      I made it:

      if ( param('acctinfo') !~ /^[a-zA-Z0-9 &,#\%\*\(\)\$\-\+\r\n]{0,800}
      $/ ) {

      And yes, adding the \r seems to have fixed it. I hadn't tried the
      \r\n prior because of something I read. In light of these suggested
      fixes, I went and found it again:



      Forbidden Characters

      Because of the way the searcher works, the following metacharacters
      should not be used, even though they are valid Perl metacharacters.

      They are:


      So is it OK or not to use these metacharacters in my matching? Not
      sure what they mean by "searcher", but they seem pretty sure you
      shouldn't use the metacharacters.

    Your message has been successfully submitted and would be delivered to recipients shortly.