Yes, another regex noob asking for regex help... ;) Can the regex in the code block below be modified so that it only allows matches that contain the word gallery in the url before the filename/extension? The url will always look like http://www.***.***/***/gallery/*/filename.*
. The wildcard after the gallery directory is a folder numbering system.
$pattern = '/\b(http:\/\/[-A-Z0-9+ \t\(\)&@#\/%?=~_|!:,.;]*[-A-Z0-9+ \t\(\)&@#\/%=~_|]\.(?:jpg|jpeg|png|gif|bmp))/si';
preg_match_all($pattern, $row['body'], $matches);