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. Link to comment https://forums.phpfreaks.com/topic/16971-help/ Share on other sites More sharing options...
ToonMariner Posted August 9, 2006 Share Posted August 9, 2006 preg_match_all('/' . $string . '.{0,50}/',...... Link to comment https://forums.phpfreaks.com/topic/16971-help/#findComment-71511 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 :$. Link to comment https://forums.phpfreaks.com/topic/16971-help/#findComment-71519 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. Link to comment https://forums.phpfreaks.com/topic/16971-help/#findComment-71724 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 Link to comment https://forums.phpfreaks.com/topic/16971-help/#findComment-71794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.