Eugene Posted August 9, 2006 Share Posted August 9, 2006 Hey all, I need a regular expression, and seeing as my regexbuddy demo expired, anyone have any other regex application?Also the regex i need is it has to match a specific word.For example... preg_match_all('/'.$string.'/', 'whatever', 'whatever', ...);Instead of matching that particular word, I need it to also match 50 characters after that word. If there aren't 50 character it matches whatever is there.Thanks. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 9, 2006 Share Posted August 9, 2006 preg_match_all('/' . $string . '.{0,50}/',...... Quote Link to comment Share on other sites More sharing options...
Eugene Posted August 9, 2006 Author Share Posted August 9, 2006 [quote author=ToonMariner link=topic=103505.msg412140#msg412140 date=1155082297]preg_match_all('/' . $string . '.{0,50}/',......[/quote]I'll try that.Edit: It does work, sorry :$. Quote Link to comment Share on other sites More sharing options...
Eugene Posted August 9, 2006 Author Share Posted August 9, 2006 [quote author=G__F__D link=topic=103505.msg412149#msg412149 date=1155083548][quote author=ToonMariner link=topic=103505.msg412140#msg412140 date=1155082297]preg_match_all('/' . $string . '.{0,50}/',......[/quote]I'll try that.Edit: It does work, sorry :$.[/quote]How can I also match [i]UP TO[/i] 50 characters before that. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 9, 2006 Share Posted August 9, 2006 '/.{0,50}' . $string . '.{0,50}/' should do the trick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.