用户: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)