@ 2018-09-18T21:38:51Z <?php
$str = 'word
one of each
one fish two fish red fish blue fish
car : carpet as java : javascript!!&@$%^&
testing, 1, 2 testing
go Go GO Stop stop
hello\nworld
hello\tworld
hello world
\t\tIntroductory Course ';
preg_match_all("/\w+/", $str, $matches);
var_dump($matches);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.6.38 , 7.1.0 - 7.1.25 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 array(1) {
[0]=>
array(35) {
[0]=>
string(4) "word"
[1]=>
string(3) "one"
[2]=>
string(2) "of"
[3]=>
string(4) "each"
[4]=>
string(3) "one"
[5]=>
string(4) "fish"
[6]=>
string(3) "two"
[7]=>
string(4) "fish"
[8]=>
string(3) "red"
[9]=>
string(4) "fish"
[10]=>
string(4) "blue"
[11]=>
string(4) "fish"
[12]=>
string(3) "car"
[13]=>
string(6) "carpet"
[14]=>
string(2) "as"
[15]=>
string(4) "java"
[16]=>
string(10) "javascript"
[17]=>
string(7) "testing"
[18]=>
string(1) "1"
[19]=>
string(1) "2"
[20]=>
string(7) "testing"
[21]=>
string(2) "go"
[22]=>
string(2) "Go"
[23]=>
string(2) "GO"
[24]=>
string(4) "Stop"
[25]=>
string(4) "stop"
[26]=>
string(5) "hello"
[27]=>
string(6) "nworld"
[28]=>
string(5) "hello"
[29]=>
string(6) "tworld"
[30]=>
string(5) "hello"
[31]=>
string(5) "world"
[32]=>
string(1) "t"
[33]=>
string(13) "tIntroductory"
[34]=>
string(6) "Course"
}
}
Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
array(1) {
[0]=>
array(35) {
[0]=>
string(4) "word"
[1]=>
string(3) "one"
[2]=>
string(2) "of"
[3]=>
string(4) "each"
[4]=>
string(3) "one"
[5]=>
string(4) "fish"
[6]=>
string(3) "two"
[7]=>
string(4) "fish"
[8]=>
string(3) "red"
[9]=>
string(4) "fish"
[10]=>
string(4) "blue"
[11]=>
string(4) "fish"
[12]=>
string(3) "car"
[13]=>
string(6) "carpet"
[14]=>
string(2) "as"
[15]=>
string(4) "java"
[16]=>
string(10) "javascript"
[17]=>
string(7) "testing"
[18]=>
string(1) "1"
[19]=>
string(1) "2"
[20]=>
string(7) "testing"
[21]=>
string(2) "go"
[22]=>
string(2) "Go"
[23]=>
string(2) "GO"
[24]=>
string(4) "Stop"
[25]=>
string(4) "stop"
[26]=>
string(5) "hello"
[27]=>
string(6) "nworld"
[28]=>
string(5) "hello"
[29]=>
string(6) "tworld"
[30]=>
string(5) "hello"
[31]=>
string(5) "world"
[32]=>
string(1) "t"
[33]=>
string(13) "tIntroductory"
[34]=>
string(6) "Course"
}
}
preferences:dark mode live preview
173.27 ms | 404 KiB | 177 Q