Hello I'm not good with regex and I would really appreciate if someone could help me out. I need a regex function that will find all patterns that start with : and are followed by at least 1 letter and maybe numbers until next occurrence of a symbol.
For example :hi/:Username@asdfasfasdf:asfs,asdfasfasfs:asdf424/asdfas
As you can see here there are 4 occurences. What I would like to achieve is to end up with an array containing:
['hi','Username','asfs','asdf424']
PS. Letters might be in other languages than english.
Downvoting for no reason... congrats
This is what I'm using so far but I suppose it would be easier with regex
public function decodeRequest() {
$req_parts = $this->getRequestParams(); // <-array of strings
$params = array();
for ($i=0; $i < count($req_parts); $i++) {
$starts = mb_substr($req_parts[$i], 0, 1, 'utf-8');
$remains = mb_substr($req_parts[$i], 0, mb_strlen($req_parts[$i]), 'utf-8');
if ($req_parts[$i] == ':') {
array_push($params,$remains);
}
}
return $params;
}