[PHP] Re: REGEX Help Please

2005-09-19 Thread Mark Rees
> I am trying to implement a regular expression so that I have a number > between 0.00 and 1.00. the following works except I can go up to 1.99 > > $regexp = "/^[0-1]{1}.[0-9]{2}/"; > You could always do this, unless you are set on using a regular expression: if($num>=0 && $num<=1.01){ echo numb

[PHP] Re: Regex help please

2004-01-11 Thread Manuel Vázquez Acosta
Try this: $pattern = '#function (\w+)\(((?:\$\w+(?:,\s*\$\w+)*?)|\s*)\)\s*\{[.\s]*((?:return\s+[^;]*\s*;)|)[ .\s]*#m'; Notice that \w means: A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". Though, any regexp for thi