The equivalent of this Perl regex in PHP

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-05-18T13:54:38Z Indexed on 2010/05/18 14:00 UTC
Read the original article Hit count: 281

Filed under:
|
|

Hi all,

What would be the equivalent in php of this regex in php:

I.e. which function would do the same job.

if (/^([a-z0-9-]+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/
  and $1 ne "global" and $1 ne "") {
    print " <tr>\n";
    print "    <td>$1</td>\n";
    print "    <td>$2</td>\n";
    print "    <td>$3</td>\n";
    print "    <td>$4</td>\n";
    print "    <td>$5</td>\n";
    print "    <td>$6</td>\n";
    print "    <td>$7</td>\n";
    print "    <td>$8</td>\n";
    print " </tr>\n";
}

Thanks very much! :-)

© Stack Overflow or respective owner

Related posts about regex

Related posts about php