I need to replace ;\s*\<do\> with \rdo in Vim. However, I also need to make sure ;\s*\<do\> does not get replaced if there is a Fortran comment symbol ! before it, i.e., in the search patter !.*;\s*\<do\>. For example, ; do in the uncommented line
j=2; do i=1, 10
should be replaced as
j=2
do i=1,10
But ; do in the following commented part should not be replaced,
k=3 ! j=2; do i=1, 10
How can I do this in vim ? I tried \(!.*\)\@!;\s*\<do\> and it does not work.