Mailing list - Entries of 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qftestJUI] Problem checking multi-line text with regular expression


  • Subject: [qftestJUI] Problem checking multi-line text with regular expression
  • From: "Michaelis, Mark" <mark.michaelis@?.com>
  • Date: Tue, 30 May 2006 11:32:35 +0200

Hello,
 
I would like to test a HTML document to contain nothing but an empty paragraph in its body. Therefore I started experimenting with a regular _expression_ as I don't want the test to break everytime when changes appear in e. g. the head. But I cannot get the regular _expression_ to run. Although I already found a hint by Bastian Bowe (25.7.2005) that newlines are not supported and you should use the workaround (.|\n)* my suggested regular expressions still doesn't work.
 
Here is the original source to check against (just the part between the body-tags):
 
  <body>
    <p>
     
    </p>
  </body>
This regular _expression_ works (but does not test the thing I would like to test):
 
(.|\n)*\<p\>(.|\n)*
 
The next step forward already does not work anymore:
 
(.|\n)*\<p\>(.|\n)*\<\/p\>(.|\n)*
 
And of course the final _expression_ I would like does not work, too:
 
(.|\n)*\<body\>( |\n|\t)*\<p\>( |\n|\t)*\<\/p\>( |\n|\t)*\<\/body\>(.|\n)*
 
or
 
(.|\n)*\<body\>[ \n\t]*\<p\>[ \n\t]*\<\/p\>[ \n\t]*\<\/body\>(.|\n)*
 
or
 
(.|\n)*\<body\>[\s\n]*\<p\>[\s\n]*\<\/p\>[\s\n]*\<\/body\>(.|\n)*
 
Any hints are welcome (before I start to write a SUT Script)...
 
Regards,
- Mark
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Videos Downloads Documentation Buy Free Trial