I'm trying to write the regex to search for image tags within a string, then to count them using either 'count' or 'substr_count'
EG: [image1], [image2] etc etc..
I'm an absolute rookie with regex so it's pretty confusing to me. Before anyone asks, yes I have done a little research into it, but I was just curious as to whether or not there is any shortcuts that are out there that myself and anyone else reading this may be missing out on.
I have also found the https://regex101.com/ however am clueless as to where to go from there.
My efforts for the example above are:
'~(\[image([\d])+\]~i'
and ..
'#[^a-z0-9.]#i'
If someone could show me how to search for the above, or point me in the right direction to a programming gold-mine it'd be more than appreciated.
Cheers, Rich