| 
	
 | 
 Posted by Jochem Maas on 09/27/05 10:43 
Jasper Bryant-Greene wrote: 
> David Pollack wrote: 
>  
>> Ok, so this is the actual code that I'm using. 
>> 
>> <? 
>> 
>> $string = "( 334, -53.44) ( 111 , 222 )"; 
>> $testStr = $string; 
>> // $string = str_replace(" ", "", $string); 
>> preg_match_all("-?([\d]+)?(\.[\d]+)?",$string, $matches); 
>  
>  
> preg_match_all("/-?([\d]+)?(\.[\d]+)?/", $string, $matches); 
 
		  ^--------------------^---------delimiters 
 
you can use almost any char you like (beware of chars that have 
special), use the same at the 
start and end, you can't use your chosen delimiter in the 
expression without escaping it (backslashing). 
 
pop quiz: 
 
preg_match_all("#rufus#i", $string, $matches); 
		       ^ 
			\--- what is this?	 
>
 
  
Navigation:
[Reply to this message] 
 |