in reply to Dear fellow monks, I need help in regex
A quick script you can run from the command line (on unix/linux) might look as follows:
This will substitute leeming=anything to leeming=food, while creating a backup of the original file as well.perl -pi.bak -e '$newMeal="food";s/leeming=.*/leeming=$newMeal/' /home +/shaolin/public_html/monkmeals.txt
Simply select something else for food, above, and change the file as much as you like.
What might be better would be to use a template system with a database, but the above works for quick one-time replacements.
-v
|
|---|