2levelsabove Posted September 10, 2008 Share Posted September 10, 2008 I tried preg_match_all('/$(.*)/n/', $txt, $matches); but that didnt seem to work please suggest Link to comment https://forums.phpfreaks.com/topic/123665-solved-how-to-get-all-text-between-the-and-newline-character/ Share on other sites More sharing options...
effigy Posted September 10, 2008 Share Posted September 10, 2008 /\$.*$/m Link to comment https://forums.phpfreaks.com/topic/123665-solved-how-to-get-all-text-between-the-and-newline-character/#findComment-638600 Share on other sites More sharing options...
2levelsabove Posted September 10, 2008 Author Share Posted September 10, 2008 you are my hero. really dumb question but i have to ask: $/m ? Link to comment https://forums.phpfreaks.com/topic/123665-solved-how-to-get-all-text-between-the-and-newline-character/#findComment-638601 Share on other sites More sharing options...
effigy Posted September 10, 2008 Share Posted September 10, 2008 From regular-expressions.info: $ Matches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Most regex flavors have an option to make the dollar match before line breaks (i.e. at the end of a line in a file) as well. Also matches before the very last line break if the string ends with a line break. /m modifier Caret and dollar match after and before newlines. Link to comment https://forums.phpfreaks.com/topic/123665-solved-how-to-get-all-text-between-the-and-newline-character/#findComment-638624 Share on other sites More sharing options...
2levelsabove Posted September 10, 2008 Author Share Posted September 10, 2008 Thank you ! Link to comment https://forums.phpfreaks.com/topic/123665-solved-how-to-get-all-text-between-the-and-newline-character/#findComment-638625 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.