-
-
/** - *Regular image path
- * by http://bbs.it-home.org
- */
- $pattern="//";
- $str='
';
- preg_match_all($pattern,$str,$match);
- print_r($match);
/*
- 1 (?s) represents Pattern.DOTALL, which is matching line breaks and is allowed in img Appears in multiple lines
- 2 .*? means non-greedy matching of any character until the following condition appears
- 3 ?: means this match but is not captured, that is, it does not appear in the result [.gif|.jpg] means or
- */
- ?>
-
-
-
Copy code
Now that we have mentioned PHP regular rules, you can refer to the previous article:
php regular expression complete tutorial 6
php regular expression complete tutorial 5
php regular expression complete tutorial 4
php regular expression complete tutorial 3
php regular expression complete tutorial 2
php regular expression complete tutorial 1
|