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 Quote 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 Quote 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 ? Quote 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. Quote 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 ! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.