Regex Match without new line ^M

I have a regex in my perl script which is /^([d.]+)s+(S+)/.
The line I am matching is Operating System: Windows XP Service Pack 3 however, there is a new line after entered after that line. So the text would be seen as Operating System: Windows XP Service Pack 3^M.

Is there anyway to get rid of the ^M using the current regex I have? It captures Windows XP Service Pack 3^Mbut the ^M doesn’t display only when I display the content using command prompt or PuTTy’s more. It displays when I edit using vi or rather vim.

Source: regex

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.