Welcome to WebmasterWorld Guest from 54.167.175.107

Forum Moderators: coopster & jatar k

regex to validate new line <br/>

   
4:32 pm on Aug 14, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I need to allow for char, num and those few signs
but cannot figure how to allow for r\n and <br />
as tags comming from a text area new line (break)

so far I got that one:

if (!preg_match("/^[a-zA-Z0-9 \&\;\.\-\,\?\r\nŠ\nŠ\r]+$/",$answer) )

6:32 pm on Aug 14, 2008 (gmt 0)

5+ Year Member



the following pattern matches paragraphs

"/\n(\s)+/U"

Hope that helps in some way

7:22 pm on Aug 14, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks
but it does not help my quest
8:25 pm on Aug 16, 2008 (gmt 0)

5+ Year Member



This will match a line feed: /\r*\n¦%0a¦%0d/
10:01 pm on Aug 16, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks, that did it.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month