PHP正则表达式错误

I am new to PHP regex. I've written below code, but there is something wrong. Could someone please suggest to me what is going wrong?

Code Link

Input:

    1 => 'String',
    2 => 'String String',
    3 => 'email',
    4 => 'date',
    5 => 'date',
    6 => 'String String',
    7 => 'String String',
    8 => 'String',
    9 => 'date'

Here is the same code from above link:

<?php 
    $text = "john123 john william johnw@hotmail.com 2015-05-09 13:21:41 2015-08-07 13:21:41 James James William William group1 2015-05-30 18:05:39"; 

    $regex = '~([a-zA-Z]+) ([a-zA-Z]+ [a-zA-Z]+) ([-\w.+]+@[-\w.+]+\.[a-zA-Z]{2,4}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z]+) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})~i';

    if ( preg_match( $regex, $text ) ) {
         echo $text . " is a valid text. We can accept it.";
    } else { 
         echo $text . " is an invalid text. Please try again.";
    } 

?>

In your test string john123 and group1 has digits which you are trying to match with [a-zA-Z]+ make them [a-zA-Z\d]+ and also other groups where digits are possible.. Use the following:

([a-zA-Z\d]+) ([a-zA-Z]+ [a-zA-Z]+) ([-\w.+]+@[-\w.+]+\.[a-zA-Z]{2,4}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z]+ [a-zA-Z]+) ([a-zA-Z\d]+) (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})

Edit: Since you are already using i (case insentitive) modifier.. you can just have [a-z]+ for alphabet and [a-z\d]+ for alphanumeric characters.

See DEMO