Per [wikibooks], "It should be remembered that Fortran is designed for scientific computing and is probably not a good choice for writing a new word processor.". Fortran doesn't have a regex concept either. This just makes [string] [challenges] more [interesting]!
In this solution, we trim the string
S, then iterate over it. Print each character unless it's a space followed by another space. [Try it Online!]
character(99)S;read(*,'(A)')S S='"'//trim(adjustl(S))//'"' do i=1,len(S);if(S(i:i+1).ne.' ')then write(*,'(A)',advance="no")S(i:i) endif;enddo;end