i want to replace a string in many files like Total:*points using sed. I simply don't know how to use sed with regex. Below is what i got. Thank you in advance!find ./ -iname skp-corr-*.txt -exec sed -i  s/(Total: )(.*)(points)/Total: X \/ 31 points/g {} \;Example file before:Total: 4 / 22 pointsExample file after:Total: x / 30 points
Replacing in files with sed using regex
sed;regular expression
sed is already built to use regex.find ./ -iname skp-corr-*.txt -exec sed -i s@Total:.*points@Total: X / 30 points@g {} \;For OS X,find ./ -iname skp-corr-*.txt -exec sed -i  -e s@Total:.*points@Total: X / 30 points@g {} \;