I need a regex that will remove this kind of Date from a String, example:
Saturday 25 February 2017 15.37 EST
I need a regex that will remove this kind of Date from a String, example:
Saturday 25 February 2017 15.37 EST
It would be a bit long. It'll match the dates with strange hours like 55:32 as well but I hope it does not matter at this case.
/(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\s\d{1,2}\s(January|February|March|April|May|June|July|August|Septemper|Obctober|November|December)\s\d{4}\s\d{1,2}\.\d{2}\sEST/ var txt = document.getElementById('txt'); var reg = /(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\s\d{1,2}\s(January|February|March|April|May|June|July|August|Septemper|Obctober|November|December)\s\d{4}\s\d{1,2}\.\d{2}\sEST/g; var newTxt = txt.innerHTML.replace(reg,""); txt.innerHTML += "<p>"+newTxt+"</p>"; <p id="txt">lets say that we've got some string with some date Saturday 25 February 2017 15.37 EST just here and also here Monday 5 December 2005 3.37 EST and here Friday 13 March 2018 12.12 EST as well.</p>