This is the example of my string.
$x = \"John Chio - Guy\"; $y = \"Kelly Chua - Woman\";
I need the pattern for the reg replace.
You can also use.
strstr( "John Chio - Guy", "-", true ) . '-';
The third parameter true tells the function to return everything before first occurrence of the second parameter.
true
Source on strstr() from php.net