tags:

views:

52

answers:

2

hi all,

here's my string:

</HEAD>
<BODY>


<html>
<head>

i need to detect the line-breaks so i used [\r\n]+ but the problem is, i need it to be optional - like the filter rule should also work if there are no line breaks at all (between rbody + html) .. how would i do that?

thx

A: 

try using [\r\n]{0,}

/Klaus

klausbyskov
`{0,*}` should either be `{0,}` or `*`.
Jordan Ryan Moore
+2  A: 

Ivan and qid have it right. [\r\n]* will match any linebreak characters in any amount, including 0. Using + meant 1 or more, thus the problem you ran into.

Chris Moschini