I have a string that looks a little like this
1: u:mads g:folk 2: g:andre u:jens u:joren
what I need is a way (I’m guessing by regex) to get for instance u:jens and the number (1 or 2) it is after.
how do I go about this in php (preferably with just one function)?
This will find all matches. If you only need the first, use
preg_matchinstead.