Get line number when matches a string

If I have a file something like as shown below,

ARM*187878*hjhj
BAG*88778*jjjj
COD*7777*kkkk
BAG*87878*kjjhjk
DEF*65656*89989*khjkk

I need the line numbers to be added with a colon when it matches the string "BAG". Here in my case, I need something like

ARM*187878*hjhj
2:BAG*88778*jjjj
COD*7777*kkkk
4:BAG*87878*kjjhjk
DEF*65656*89989*khjkk

I can use this

awk '{print FNR ":" $0}'

for getting the line numbers. Can anyone advise how to fetch based on the beginning of s string

 awk '/^BAG/{print FNR ":" $0;next}{print}' infile
awk ' /^BAG/ {printf("%d:", FNR) }
        print $0  ' oldfile > newfile
awk '/^BAG/{$0=NR":"$0}1'  infile

perl solution:-

perl -wnl -e '/^BAG/ and print "$.:$_" or print $_ ;' infile.txt

:cool:;):cool:

---------- Post updated at 15:06 ---------- Previous update was at 15:01 ----------

or more simpler:-

perl  -i.bac -wpl -e 's/(^BAG.+)/$.:$&/ ;' infile.txt

:):):slight_smile: