search and replace


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. perl -pi -e "s/<h4>Page(\s\d*\s)of(\s\d*)<\/h4>/<p class=\"right\">Page\1of\2<\/p>/g" */object/*.htm
  2.  
  3. //also
  4.  
  5. perl -pi -e 's/<li\sid=\"home\"><a\shref=\".*\/index\.html\">Home<\/a><\/li>/<li id=\"home\"><a href=\"\.\.\/\.\.\/\.\.\/\.\.\/">Home<\/a><\/li>/gcx' */*/*/*/index.html
  6.  
  7.  
  8. //also
  9.  
  10.  
  11. perl -pi -e 's/,\s:\@total_index\s=>\s\d\s//g' *.haml
  12.  
  13. removes
  14. , :@total_index => 5
  15.  
  16. from
  17. =partial('footer-series', :locals => {:@current_index => 1, :@total_index => 5 })
  18.  
  19.  
  20. NOTES:
  21.  
  22. escape @

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.