Regexpr Next Input

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Remember s/// (regular expression replacement) commands in first input; apply them to second input.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

s/#/pyon/
s/%/pyon/
s/q/fumu/
s/-/fumu/
s/^$/yeah/
s/".*"/yeah/
s/[0-9][0-9]*/howa/
s/[~().]/howa/
s/[;*{}]/kira/
s/ r.*/kira/
s/[A-Z]/yeah/
s/s/yeah/
s/.*1/tamago/
s/0.*0/wa/
s/P.*s/nani/
s/p.*S/iro/
s/the/yeah/
s/^[^pity ]/yeah/
s/....$/yeah/

Sample output:


Sample input:_

/*(     FOUR THOUSAND CHARACTERS IN SEARCH OF AN INTERPRETER     )/q;#/#{}def%*/
/*(     A Trilingual Tripartite Tragicomedy of Epic Proportions         )/q;#%*/
/*(     by KirarinSnow, Self-Declared Delegate from Bouvet Island       )/q;#%*/



/*/q;#%     PREFACE
     #%     
     #%     Behold, a dramatic script for the modern age!
     #%     
     #%     Four thousand characters (far more than Shakespeare ever managed!
     #%     how times change...), stumble upon a mysterious script claiming
     #%     to unlock the secrets of a certain "Google Code Jam Africa 2010
     #%     Qualification Round" --- provided that, for each round, they locate
     #%     the correct interpreter to decipher the cryptic markings strewn
     #%     across the script. But which interpreters will help them pass
     #%     the three stages of their epic quest? One wrong choice, and our
     #%     heroes may find themselves facing the terrors of out-of-range
     #%     exceptions, infinite loops, and even the mythical but deadly
     #%     segmentation fault. Will our characters ever succeed? Only time
     #%     will tell.
     #%     
     #%     At the start of their journey, our heroes discover three lines
     #%     that may lead them in the right direction:
     #%     
     #%       $ swipl -q -c script < A-input.in
     #%       $ sed -f script < B-input.in
     #%       $ gs -q -dNOPROMPT -dNODISPLAY -dBATCH script < C-input.in
   #%*/



/*/q;#%     TABLE OF CONTENTS
     #%     
     #%     Act A. "Store Credit"
     #%            The Introductory Prologue, in Prolog           45
     #%     Act B. "Reverse Words"
     #%            Some Lines to Be Said, in sed                  71
     #%     Act C. "T9 Spelling"
     #%            A Final Postscript, in PostScript              95
   #%*/



/*/q;#(*/%  ACT A. "Store Credit"
/*/q;#*/%%         The Introductory Prologue, in Prolog
/*/q;#*/    
/*/q;#*/    compute(Case, Total) :-
/*/q;#*/        readln([Credit]),
/*/q;#*/        readln(_),
/*/q;#*/        readln(List),
/*/q;#*/        member(Item, List),
/*/q;#*/        Match is Credit - Item,
/*/q;#*/        member(Match, List),
/*/q;#*/        nth1(Index1, List, Item),
/*/q;#*/        nth1(Index2, List, Match),
/*/q;#*/        Index1 < Index2,
/*/q;#*/        format('Case #~d: ~d ~d~n', [Case, Index1, Index2]),
/*/q;#*/        !,
/*/q;#*/        Case >= Total.
/*/q;#*/    
/*/q;#*/    :-
/*/q;#*/        prompt1(''),
/*/q;#*/        readln([Total]),
/*/q;#*/        between(1, Total, Case),
/*/q;#*/        compute(Case, Total).
/*/q;#)%*/



/*/q;#(     ACT B. "Reverse Words"
#######            Some Lines to Be Said, in sed
            
            1 s/.*$/0<>0123456789/
	    1 h
	    1 d
            
            s/$/0/
            :reverse
            s/^\([^0 ]*\) \(.*0\)/\2 \1/
            t reverse
            s/0//
            
            x
            :incr
            s/9</<0/
            t incr
            s/^</0</
            s/\(.\)<\(.*\)\(>.*\1\(.\)\)/\4\2<\3/
            x
            G
            s/\(.*\)\n\(.*\)<.*$/Case #\2: \1/
#)%*/



/*/q;#%     ACT C. "T9 Spelling"
#%%%%%%            A Final Postscript, in PostScript
#           
#           1 1 (%stdin) (r) file token pop {
#               (Case #) print 5 string cvs print (:) print
#               (%stdin) (r) file 1000 string readline pop
#               [ exch {
#                   dup ( ) 0 get eq {pop (0)} {
#                       [ exch (a) 0 get sub dup 
#                       [ 6 {1 2 3} repeat 4 2 {1 2 3} repeat 4 ] exch get {
#                           dup (22233344455566677778889999) exch get exch
#                       } repeat pop ]
#                   } ifelse
#               } forall ] [ exch ( ) exch {
#                   2 copy 0 get exch 0 get eq {( ) exch} if
#               } forall ] {
#                   {(%stdout) (w) file exch write} forall
#               } forall () =
#           } for
#%*/



/*/q;#%     FINIS     %#;p\*/

Sample output:

yeahkirahowa     yeahOUR THOUSAND CHARACTERS IN SEARCH OF AN INTERPRETER     )/fumu;pyon/#{}defpyyeah
yeahkirahowa     yeah Trilingual Tripartite Tragicomedy of Epic Proportionyeah         )/fumu;pyonpyyeah
yeahkirahowa     by yeahirarinSnow, SelffumuDeclared Delegate from Bouvet Iyeahland       )/fumu;pyonpyyeah
yeah
yeah
yeah
yeahkira/fumu;pyonpyon     yeahREyeah
     pyonpyon yeah
     pyonpyon     yeahehold, a dramatic yeahcript for yeah modern yeah
     pyonpyon yeah
     irohakespeare ever manayeah
     pyonpyon     how timeyeah changehowa..), stumble upon a mysterious script claiyeah
     pyonpyon     to unlock yeah yeahecrets of a certain "yeahoogle Code Jam Africa yeah
     pyonpyon     yeahualification Round" fumu-- provided that, for eachyeah
     pyonpyon     yeah correct interpreter to decipher the cryptic markingyeah styeah
     pyonpyon     acroyeahs yeah scripthowa yeahut which interpreters will help them yeah
     pyonpyon     yeah three yeahtages of their epic fumuuest? yeahne wrong choice, andyeah
     pyonpyon     heroeyeah may find yeahmselves facing the terrors of outfumuof-ryeah
     pyonpyon     exceptionyeah, infinite loops, and even yeah mythical but deyeah
     pyonpyon     yeahegmentation faulthowa yeahill our characters ever succeed? Only yeah
     pyonpyon     will tellyeah
     pyonpyon yeah
     pyonpyon     yeaht yeah yeahtart of their journey, our heroes discover three lyeah
     pyonpyon     that may lead yeahm in theyeah
     pyonpyon yeah
     pyonpyon       $ yeahwipl fumufumu -c script < yeah-inputhoyeah
     pyonpyon       $ yeahed fumuf script < yeah-inputhoyeah
     pyonpyon       $ gyeah fumufumu -dyeahOnanicript < C-inputhoyeah
   pyonpyonkyeah
yeah
yeah
yeah
yeahkira/fumuyeah
     pyonpyon yeah
     pyonpyon     yeahct Ahowa yeah
     pyonpyon            yeahhe Introductory Prologue, in Prolog           yeah
     pyonpyon     yeahct Bhowa yeah
     iroaid, in sed                  yeah
     pyonpyon     yeahct Chowa yeah
     irocript              yeah
   pyonpyonkyeah
yeah
yeah
yeah
yeahkira/fumu;pyonhowa*/pyon  yeahCT A. yeah
yeahkira/fumu;pyon*/pyon%         yeahhe Introductory Prologue, in Pryeah
yeahkira/fumu;pyon*/yeah
yeahkira/fumu;pyon*/    computehowayeahayeahe, Total) :yeah
yeahkira/fumu;pyon*/       yeah
yeahkira/fumu;pyon*/       yeah
yeahkira/fumu;pyon*/       yeah
yeahkira/fumu;pyon*/        memberhowayeahtem, Liyeayeah
yeahkira/fumu;pyon*/        yeahatch iyeah Credit fumu Iyeah
yeahkira/fumu;pyon*/        memberhowayeahatch, Liyeayeah
tamago, Liyeaht, Ityeah
yeahkira/fumu;pyon*/        nthhowahowayeahndex2, Liyeaht, Matyeah
yeahkira/fumu;pyon*/        yeahndexhowa < Indyeah
yeahkira/fumu;pyon*/        formathowa'yeahayeahe #~d: ~d ~d~n', [Case, Indexhowa, Indexyeah
yeahkira/fumu;pyon*/      yeah
yeahkira/fumu;pyon*/        yeahayeahe >= Totalyeah
yeahkira/fumu;pyon*/yeah
yeahkira/fumu;pyon*/    :yeah
yeahkira/fumu;pyon*/        prompthowahowayeah
yeahkira/fumu;pyon*/       yeah
yeahkira/fumu;pyon*/        betweenhowahowa, yeahotal, Cayeayeah
yeahkira/fumu;pyon*/        computehowayeahayeahe, Totyeah
yeahkira/fumu;pyonhowapyyeah
yeah
yeah
yeah
yeahkira/fumu;pyonhowa     yeahCT B. yeah
iroaid, inyeah
        yeah
tamago23456yeah
yeah    hoyeah
yeah    hoyeah
        yeah
            yeah/$/hyeah
            :reveryyeah
tamyeah
            tyeah
            yeah/hoyeah
        yeah
         yeah
            :yeah
            yeah/howa<yeah
            t yeah
            yeah/^</hoyeah
            yeah/\howa.\)<\(.kira\)\(>.*\howa\(.\)\)/\4\2yeah
         yeah
            yeah
tamyeah
pyonhowapyonkyeah
yeah
yeah
yeah
yeahkira/fumu;pyonpyon     yeahCT Chowa yeah
irocyeah
pyon       yeah
tamago howapyonyeahtdin) (r) file token pop yeah
pyon               howayeahayeahe #) print howa string cvs print (:) pyeah
pyon               howapyonyeahtdin) (r) file howa stringyeah
pyon               [ exch yeah
pyon                   dup howa ) howa get efumu kirapop (0yeah
pyon                       [ exch howaa) howa get yeahub yeah
tamago 2 3}yeah
pyon                           dup howahowa) exch get yeah
pyon                       kirayeah
pyon                   kira ifelyyeah
pyon               kira forall ] [ exch howa ) exyeah
pyon                   howa copy wa get efumu kirahowa ) exchyeah
pyon               kira forallyeah
pyon                   kirahowapyonyeahtdout) (w) file exch write} foyeah
pyon               kira forall howyeah
pyon           kirayeah
pyonpyonkyeah
yeah
yeah
yeah
yeahkira/fumu;iro     %#;yeah

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1yvl870.04132010/03/27 00:10:330B / 39B / 45B

Perl _

RankUserSizeTimeDateStatistics
1ySas520.07082010/03/27 19:27:110B / 25B / 27B
2KirarinSnow600.00762010/04/01 13:15:330B / 31B / 27B

JavaScript _

RankUserSizeTimeDateStatistics
1nn2200.09822010/03/27 17:46:530B / 120B / 98B
2xulapp2280.09312010/03/26 23:30:280B / 102B / 124B
3murky-satyr2530.07382010/03/25 22:08:110B / 157B / 93B

C _

RankUserSizeTimeDateStatistics
1nn2230.03702010/04/04 01:49:180B / 121B / 100B
251b2310.05912010/04/03 00:26:360B / 123B / 106B

D _

RankUserSizeTimeDateStatistics
151b2210.04042010/04/04 03:26:200B / 153B / 64B

AWK _

RankUserSizeTimeDateStatistics
1nn920.01632010/03/30 23:23:050B / 48B / 44B

sed _

RankUserSizeTimeDateStatistics
1zzo38110.00622010/04/04 12:40:320B / 9B / 1B
2KirarinSnow110.00752010/04/06 11:17:110B / 9B / 1B
3KirarinSnow(embed)2260.00082010/03/26 00:14:570B / 105B / 103B
4msk2350.01142010/03/29 20:29:430B / 107B / 109B

Bash _

RankUserSizeTimeDateStatistics
1msk120.03042010/03/25 15:44:170B / 8B / 3B

Zsh _

RankUserSizeTimeDateStatistics
1zzo38120.03152010/04/04 12:29:550B / ?B / ?B
2zzo38(post-mortem)100.19072010/04/12 05:05:040B / ?B / ?B

Postscript _

RankUserSizeTimeDateStatistics
1yshl7280.19812010/03/28 23:37:22300B / 285B / 134B
2yshl(ascii)11690.19512010/03/28 23:37:390B / 810B / 184B

Vim _

RankUserSizeTimeDateStatistics
1nn290.05792010/03/30 13:11:470B / 11B / 15B

Groovy _

RankUserSizeTimeDateStatistics
1nn1392.54722010/03/31 13:01:110B / 81B / 53B

Language Ranking_

RankLangUserSizeScore
1Zshzzo38(post-mortem)1010000
2sedzzo38119090
3Bashmsk128333
4Vimnn293448
5PerlySas521923
6Rubyyvl871149
7AWKnn921086
8Groovynn139719
9JavaScriptnn220454
10D51b221452
11Cnn223448
12Postscriptyshl728137

return to the top page