I am trying to alter the reg. expression below to take into account an extra space between the month and the day as follows:
(?:(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\s\d{1,2}\s\d{1,2}:\d{1,2}
rats 1.4K Sep 9 08:10 /opt/rats/prod ===> it returns blank
rats 1.4K Sep 12 08:10 /opt/rats/prod ===> returns "Sep 12 08:10"
If I add \s it works in the first string but it breaks on the second string:
(?:(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\s\s\d{1,2}\s\d{1,2}:\d{1,2}
Thank you
To match exactly extra space
(?:(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\s{1,2}\d{1,2}\s\d{1,2}:\d{1,2}
To match any count of extra spaces
(?:(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\s+\d{1,2}\s\d{1,2}:\d{1,2}