Tag Archives: preg

Regular expressions: positive and negative lookaheads and lookbehinds

Do you work with regular expressions sometimes? If you do, and you don’t know about lookbehinds and lookaheads, you are missing out on a fantastic feature. I’m just pasting in something I said to some colleagues. Use your imagination and Google to extract the rest of the blog post 😉 [10/30/14, 10:11:44 PM] Kevin Kaland: man [10/30/14, 10:11:53 […]
Posted in Life of a Web Developer, Regex, Tips | Also tagged , , , , , , , , , | Leave a comment

Linux tip – regular expression find and replace in all files in a directory

As you may have seen me tweet, I’ve been looking for a way to do this. I didn’t want to manually change my Apache configuration to reflect my new internal IP address. After some Internet searching, I stumbled across this gem: http://www.linuxquestions.org/questions/linux-software-2/find-and-replace-text-in-multiple-file-203801/#post1742045 find . -name '[^.]*' | xargs perl -pi -e 's/192\.168\.1\.3/192\.168\.0\.3/g' I adapted it […]
Posted in Life of a Web Developer, Tips | Also tagged , , , , , , , , , , | 3 Comments