You are not getting both f
and b
because exec()
finds matches successively on each call.
It is usually used in a while
loop to find all the matches.
If you were using the native library, then I would have advised you to use string.match()
to find all the matches at once.
Check the documentation of exec()
in your situation, and then look for a method similar to string.match()
.