用戶:Antigng-bot/regex
外觀
- Wikipedia:機械人/申請/Antigng-bot/30用來判斷參數格式是否符合Module:Citation/CS1/Date validation要求的那個巨大的狀態機當然不是手寫的,而是從該模塊中給出的正則表達式自動生成的:
(%d%d%d%d-%d%d-%d%d)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d?, +[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d?–[1-9]%d?, +[1-9]%d%d%d%a?)|([1-9]%d? +(([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d%d%d%a?)|([1-9]%d?–[1-9]%d? +(([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d? – (([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d?, +[1-9]%d%d%d?%a?)|([1-9]%d? +(([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d%d%d – [1-9]%d? +(([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d?, +[1-9]%d%d%d – (([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)) +[1-9]%d?, +[1-9]%d%d%d%a?)|(([Ww]inter|[Ss]ummer) +[1-9]%d%d%d–%d%d%a?)|(([Ww]inter|[Ss]ummer) +[1-9]%d%d%d–[1-9]%d%d%d%a?)|(([Ww]inter|[Ss]ummer) +[1-9]%d%d%d–[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)|([Ww]inter)|([Ss]ummer)) +[1-9]%d%d%d – (([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)|([Ss]ummer)|([Ww]inter)) +[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)|([Ss]ummer)|([Ww]inter))–(([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)|([Ss]ummer)|([Ww]inter)) +[1-9]%d%d%d%a?)|((([Jj]an(uary)?)|([Ff]eb(ruary)?)|([Mm]ar(ch)?)|([Aa]pr(il)?)|([Mm]ay)|([Jj]un(e)?)|([Jj]ul(y)?)|([Aa]ug(ust)?)|([Ss]ep(tember)?)|([Oo]ct(ober)?)|([Nn]ov(ember)?)|([Dd]ec(ember)?)|([Ww]inter)|([Ss]ummer)|[Cc]hristmas) +%d%d%d%d%a?)|([1-9]%d%d%d?–[1-9]%d%d%d?%a?)|([1-9]%d%d%d–%d%d%a?)|([1-9]%d%d%d?%a?)|([1-9]%d%d%d年[1-9]%d?月[1-9]%d?日)|([1-9]%d%d%d年[1-9]%d?月)|([1-9]%d%d%d?年)|(%d%d%d%d-%d%d)
所用到的代碼如下:
- User:Antigng-bot/regex/regexLexerGenerate
- User:Antigng-bot/regex/regexFrontEnd(User:Antigng-bot/regex/regexFrontEnd.h)
- User:Antigng-bot/regex/regexBackEnd(User:Antigng-bot/regex/regexBackEnd.h)
- User:Antigng-bot/regex/NFARuntime(User:Antigng-bot/regex/NFARuntime.h)
- User:Antigng-bot/regex/DFAProcess(User:Antigng-bot/regex/DFAProcess.h)
- User:Antigng-bot/regex/DFAMinimize(User:Antigng-bot/regex/DFAMinimize.h)
- User:Antigng-bot/regex/DFAOptimize(User:Antigng-bot/regex/DFAOptimize.h)
- User:Antigng-bot/regex/output(User:Antigng-bot/regex/output.h)