User:Ohconfucius/test/MOSNUM dates code.js: Difference between revisions

Content deleted Content added
tweaks
tweaks to ordinals
Line 171:
 
//remove unlinked ordinal date formats
ohc_regex(/(\W)@Day, @Day(\s(?:and|&|to|or)\s)@Day(?:\sof\s?)?(?:[ ]| )@Month(?=\W)/gi, '$1@Day1DD1, @Day2DD2$2@Day3DD3 @LMonth');
ohc_regex(/(\W)@DD@th?(\s(?:and|&|to|or)\s)@DD@th?(?:\sof\s?)?(?:[ ]| )@Month(?=\W)/gi, '$1@Day1DD1$2@Day2DD2 @LMonth');
ohc_regex(/(\W)(?:the |)@DD@th?(?:\sof)\s@Month,? @YYYY(?=\W\D)/gi, '$1@Day @LMonth @YYYY');
ohc_regex(/(\W)(?:the |)@DD@th?(?:\sof)\s@Month(?=\W\D)/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@Day(?:\sof|)(?:[ _]| )@Month(?=[^\|\]\w\d])/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@DD<sup>@th?<\/sup>(?:\sof\s?)?\s(@Month)(?=\W\D)/gi, '$1@Day @LMonth');
ohc_regex(/(\W)@Month\s(?:the\s)?@Day,(?:\sthe\s)?(?: |&nbsp;)@Day(\s(?:and|&|to|or)(?:[ _]|&nbsp;))(?:the\s)?@Day(?=[^\]\|\w\d]\D)/gi, '$1@LMonth @Day1DD1, @Day2DD2$2@Day3DD3');
ohc_regex(/(\W)(@month)\s(@day)((?:,\s@day){0,6}),?(\/|\s?[-–]\s?|\s(?:and|&|to|or)\s+?)@Day(?:,?(?:[ _]|&nbsp;)|\sof\s)?(\d{3,4}\W\D)/gi, '$1$2 $3$4$5@Day, $6');
ohc_regex(/(\W)@Month(?:[ ]|&nbsp;)(?:the\s)?@Day(?=[^\]\|\w\d]\D)/gi, '$1@LMonth @DD');