[Solved] Get Full Date Only in Regex [closed]
You may use the following regex pattern: (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2}(?: \d{4})? var dates = [“Nov 29 2019”, “abc 0 May 30 2020”, “ddd Apr 3 2021 efg”, “0 Jan 3 hellodewdde deded”, “Green eggs and ham”]; var months = “(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)”; var regex = new RegExp(months + ” \\d{1,2}(?: \\d{4})?”); var matches = []; for (var i=0; … Read more