Question Details

No question body available.

Tags

php preg-match

Answers (1)

Accepted Answer Available
Accepted Answer
July 15, 2026 Score: 3 Rep: 17,718 Quality: High Completeness: 60%

You don't really need to use a complex regular expression for this. Normal PHP string functions can do the job. For instance:

$parts         = explode("'", $line);
$steamid      = $parts[1];
$entityid     = $parts[3];
$chataudience = $parts[5];
$playername   = $parts[7];
$message_text  = ltrim($parts[8], ": ");

Live demo here: https://3v4l.org/ZA5D2#v8.5.7