1) "preg_match() expects parameter 4 to be long, string given".
Expand|Select|Wrap|Line Numbers
- <?php
- $desc= "th793; D. A. Melnick; Zinc Oxide Photoconduction, an Oxygen Adsorption; J. Chem. Phys., 26, (1957), p1136; doi:10.1063/1.1743483; http://jcp.aip.org/resource/1/jcpsa6/v26/i5/p1136_s1 Donald A. Melnick ;;FROM RCONCL;; _nowdatebk: 2015-01-10 10:26:28.575267 ;";
- preg_match("/doi/i", $desc, $matches, 'PCRE_DOTALL' );
- print_r($matches);
- ?>
Expand|Select|Wrap|Line Numbers
- <?php
- $desc= "th793; D. A. Melnick; Zinc Oxide Photoconduction, an Oxygen Adsorption; J. Chem. Phys., 26, (1957), p1136; doi:10.1063/1.1743483; http://jcp.aip.org/resource/1/jcpsa6/v26/i5/p1136_s1 Donald A. Melnick ;;FROM RCONCL;; _nowdatebk: 2015-01-10 10:26:28.575267 ;";
- preg_match("/doi.*;/i", $desc, $matches, 'PCRE_DOTALL' );
- print_r($matches);
- ?>
http://php.net/manual/en/function.preg-match.php
http://php.net/manual/en/regexp.reference.dot.php
The code is working if i am not using constant 'PCRE_DOTALL'. But, i believe in some cases i may need search through several lines, thus i asked the questions above.
Thanks in advance!