Regular expression

a=“Subsequent deposit instructions not found or incomplete.Initial
deposit instructions not found or incomplete.Analysis complete for
policy (SS13027985).Analysis complete for policy (SS13027985), coverage
(01).Premium calculation restricted on coverage (01). Rates not
re-calculated.”

puts a[/(.)(Analysis complete for policy (.))(.)(Analysis complete
for policy (.
))/,4].sub(/(.?)/,"").sub(/.(.)/,"")

I have written successfully to get the output as below

“Analysis complete for policy , coverage (01)” , Could you please
suggest me to write the better regular expression compared to what I
have written?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs