Question: I'm trying to define a regex in php to extract words but i didn't succeed... 
My string is always in this format: "toto=on test=on azerty=on gogo=on" 
what I would like to do is to get in an array the values toto, test,azerty and gogo. Can someone help ? 

that's what i tried so far : `/([^\s]|[w]*?=)/`

Answer: 
A different approach to this question would be this way

```
<?php

$str = "toto=on test=on azerty=on gogo=on";
$res = str_replace("=on","", $str);
$array = explode(" ", $res);
print_r($array); //Array ( [0] => toto [1] => test [2] => azerty [3] => gogo )

?>

```
You can juse use `explode()`:

```
$str = 'toto=on test=on azerty=on gogo=on';
$words = array_map(function($item){ return substr($item, 0, -3); }, explode(' ', $str));

```