| 
 Posted by billy on 11/03/05 20:51 
| Does anyone know if it's possible to use regular expressions to grab 
| all content between two words.  For example.... 
| 
| ------ 
| This is some example text to illustrate my problem and here's another 
| my for you. 
| ------ 
| 
| I want to grab all text between the words 'some' and 'my' with the 
| correct result being ' example text to illustrate ' 
| 
| The following doesn't work with either ereg or preg_match... 
| 
| some([^(my)]+)my 
 
if it's text, regular expressions can do it. ;^) 
 
(?:\bsome\b)(.*?)(?:\bmy\b) 
 
hth, 
 
me
 
[Back to original message] 
 |