This should be very simple and short, but i cannot think of a good and short way of doing this:   

I have a string for instance: 

> 
> 'How many roads must a man walk down Before you call him a man? How
>  many seas must a white dove sail Before she sleeps in the sand? Yes,
>  and how many times must the cannon balls fly Before they're forever
>  banned?' 
> 
> 
> 

and I want to substring a word say "how" with a running number so i get:  

> 
> '[1] many roads must a man walk down Before you call him a man? [2]
>  many seas must a white dove sail Before she sleeps in the sand? Yes,
>  and [3] many times must the cannon balls fly Before they're forever
>  banned?' 
> 
> 
>