roopurt18 Posted June 12, 2007 Share Posted June 12, 2007 Does linux have a command similar to preg_replace()? I have a grep command dumping output into a file but I'd like to reformat the output by replacing certain bits of text (found with regexps) with other bits of text to make viewing in a web browser more convenient. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/55324-preg_replace-for-command-line/ Share on other sites More sharing options...
effigy Posted June 12, 2007 Share Posted June 12, 2007 There's sed, but it doesn't have the full-blown capabilities of PCRE. Perl's command line is your best bet. Quote Link to comment https://forums.phpfreaks.com/topic/55324-preg_replace-for-command-line/#findComment-273472 Share on other sites More sharing options...
solarisuser Posted August 17, 2007 Share Posted August 17, 2007 Since I'm a big PHP user, I just install PHP on my machine, and then use preg_replace on the command line. It works great on the Windows and Linux platforms. Quote Link to comment https://forums.phpfreaks.com/topic/55324-preg_replace-for-command-line/#findComment-326415 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.