Posted under » PHP on 4 Sep 2020
Regex to look for blocks of string.
1 2 3 4 5 6 7 8 9 10 11 12 | <¿php $meh = file( "custom_login_lms.txt" ); $beh = $meh [0]; // 1st line only $pattern = "/(Q[A-Z]+[0-1][A-Z]+[a-z]+[0-1][A-Z]+[A-z]+=)([b7].*4d)(ee.*a)/i" ; if (preg_match_all( $pattern , $beh , $matches )) { print_r( $matches ); } echo "one = " . $matches [1][0]; echo "two = " . $matches [2][0]; echo "three = " . $matches [3][0]; |
Read earlier Regex article.