Mac: replace text inside files in directory using regular expression <p>I need to replace all matches (regular expression) in directory from "*::" to be "\*::" examples: (in multiple php files)</p> <pre><code>ID:: user:: process:: .... </code></pre> <p>to be:</p> <pre><code>\ID:: \user:: \process:: </code></pre> <p>I currently use,single commands</p> <pre><code>find . -type f -name '*.php' -exec sed -i '' s/ID::/\\\\ID::/ {} + find . -type f -name '*.php' -exec sed -i '' s/user::/\\\\user::/ {} + find . -type f -name '*.php' -exec sed -i '' s/process::/\\\\process::/ {} + </code></pre> <p>how to write regular expression to replace any "*::" => "\*::"</p> <p>thanks,</p>