I work with perl regex like this:
/(^.*)XXX/g
I want this regular expression to match the text type
******XXX****XXX***XXX
so in this case regexp will match 3 times and provide the following results:
******XXX****XXX*** ******XXX**** ******
However, when I put this regular expression in a list context like this
while($_=~/(^.*)XXX/g)
there is only one match, and thatβs
******XXX****XXX***
Where am I mistaken?
source share