My most used Perl regular expressions.

Match full path of image and extention and store in an array. my @arr = ($string =~ m/([\/A-Za-z0-9_\-]+\.(?:jpg|png))/g);
Add something to the end of a line. $string =~ s/(.*)/$1 something/;
Add something to the beginning of a line. $string =~ s/(.*)/something $1/;
Match an HTML <img> tag. $string =~ m/(<img.*?>)/;
This entry was posted in Programming, Webhosting and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.