I would like to ask you about regular expressions preg_match have outlined below. I wish to express their approval to add white space. For one and the other expression. I know that white space is represented by a /s But I can not deal with it. please help
'string' => array(
'pattern' => '^([a-zA-Z ]+)$',
),
'numericString' => array(
'pattern' => '^[a-zA-Z0-9]+$',
)
'numeric' => array(
'pattern' => '^[0-9]+$',
),
Please help i need add white space to any.
White space is represented by
\sin PCRE syntax, not/s. Try this:You may find this site helpful for testing regexes with visualisations of matches:
http://www.regexpal.com/