I've a strings which look like:
array(
'a few words 10g some more words',
'a few words 100 g some more words',
'a few words 100g/25mg some more words',
)
and I'm trying to extract the number which preceeds the letter g. In some of the strings the number and letter g will have a space between them, in other cases they will be beside each other.
What regex do I need to use to match either pattern?