Advertisement
szabozoltan69

maintenance redirection regexp

Mar 4th, 2019
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.30 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #https://affy.blogspot.com/p5be/ch10.htm
  3.  
  4. $example_replcd1 = $example_string1 = "/valami/akarmi/ezaz.html";
  5. $example_replcd2 = $example_string2 = "/valami/akarmi/css";
  6. $example_replcd3 = $example_string3 = "/css/valami/akarmi/ezaz.css";
  7. $example_replcd4 = $example_string4 = "/valami/akarmi/js";
  8. $example_replcd5 = $example_string5 = "/js/valami/akarmi/ezaz.js";
  9. $example_replcd6 = $example_string6 = "/valami/akarmi/img";
  10. $example_replcd7 = $example_string7 = "/img/valami/akarmi/ezaz.img";
  11.  
  12. #$match1          = $example_string1 =~ m/^(.*)$/;
  13. #$match2          = $example_string2 =~ m/^(.*)$/;
  14. #$match3          = $example_string3 =~ m/^(.*)$/;
  15. #$match4          = $example_string4 =~ m/^(.*)$/;
  16. #$match5          = $example_string5 =~ m/^(.*)$/;
  17. #$match6          = $example_string6 =~ m/^(.*)$/;
  18. #$match7          = $example_string7 =~ m/^(.*)$/;
  19.  
  20. $match1          = $example_string1 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  21. $match2          = $example_string2 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  22. $match3          = $example_string3 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  23. $match4          = $example_string4 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  24. $match5          = $example_string5 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  25. $match6          = $example_string6 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  26. $match7          = $example_string7 =~ m/^(?!\/css\/|\/img\/|\/js\/)(.+)$/;
  27.  
  28. $replc1          = $example_replcd1 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  29. $replc2          = $example_replcd2 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  30. $replc3          = $example_replcd3 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  31. $replc4          = $example_replcd4 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  32. $replc5          = $example_replcd5 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  33. $replc6          = $example_replcd6 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  34. $replc7          = $example_replcd7 =~ s/^(?!\/css\/|\/img\/|\/js\/)(.+)$/found/;
  35.  
  36.  
  37. print("\$match1        = $match1\n");
  38. print("\$match2        = $match2\n");
  39. print("\$match3        = $match3\n");
  40. print("\$match4        = $match4\n");
  41. print("\$match5        = $match5\n");
  42. print("\$match6        = $match6\n");
  43. print("\$match7        = $match7\n");
  44. print("===\n");
  45. print("\$replc1        = $replc1\n");
  46. print("\$replc2        = $replc2\n");
  47. print("\$replc3        = $replc3\n");
  48. print("\$replc4        = $replc4\n");
  49. print("\$replc5        = $replc5\n");
  50. print("\$replc6        = $replc6\n");
  51. print("\$replc7        = $replc7\n");
  52. print("\$example_string1       = $example_string1\n");
  53. print("\$example_string2       = $example_string2\n");
  54. print("\$example_string3       = $example_string3\n");
  55. print("\$example_string4       = $example_string4\n");
  56. print("\$example_string5       = $example_string5\n");
  57. print("\$example_string6       = $example_string6\n");
  58. print("\$example_string7       = $example_string7\n");
  59. print("===\n");
  60. print("\$replaced_string1       = $example_replcd1\n");
  61. print("\$replaced_string2       = $example_replcd2\n");
  62. print("\$replaced_string3       = $example_replcd3\n");
  63. print("\$replaced_string4       = $example_replcd4\n");
  64. print("\$replaced_string5       = $example_replcd5\n");
  65. print("\$replaced_string6       = $example_replcd6\n");
  66. print("\$replaced_string7       = $example_replcd7\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement