Regexpr Next Input
Submit
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
Rank | User | Size | Time | Date | Statistics |
---|
1 | yvl | 87 | 0.0413 | 2010/03/27 00:10:33 | 0B / 39B / 45B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ySas | 52 | 0.0708 | 2010/03/27 19:27:11 | 0B / 25B / 27B |
2 | KirarinSnow | 60 | 0.0076 | 2010/04/01 13:15:33 | 0B / 31B / 27B |
3 | Sisyphus | 37 | 0.0302 | 2024/06/06 14:58:33 | 0B / 15B / 20B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 220 | 0.0982 | 2010/03/27 17:46:53 | 0B / 120B / 98B |
2 | xulapp | 228 | 0.0931 | 2010/03/26 23:30:28 | 0B / 102B / 124B |
3 | murky-satyr | 253 | 0.0738 | 2010/03/25 22:08:11 | 0B / 157B / 93B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 223 | 0.0370 | 2010/04/04 01:49:18 | 0B / 121B / 100B |
2 | 51b | 231 | 0.0591 | 2010/04/03 00:26:36 | 0B / 123B / 106B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | 51b | 221 | 0.0404 | 2010/04/04 03:26:20 | 0B / 153B / 64B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 92 | 0.0163 | 2010/03/30 23:23:05 | 0B / 48B / 44B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | zzo38 | 11 | 0.0062 | 2010/04/04 12:40:32 | 0B / 9B / 1B |
2 | KirarinSnow | 11 | 0.0075 | 2010/04/06 11:17:11 | 0B / 9B / 1B |
3 | KirarinSnow(embed) | 226 | 0.0008 | 2010/03/26 00:14:57 | 0B / 105B / 103B |
4 | msk | 235 | 0.0114 | 2010/03/29 20:29:43 | 0B / 107B / 109B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | msk | 12 | 0.0304 | 2010/03/25 15:44:17 | 0B / 8B / 3B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | yshl | 728 | 0.1981 | 2010/03/28 23:37:22 | 300B / 285B / 134B |
2 | yshl(ascii) | 1169 | 0.1951 | 2010/03/28 23:37:39 | 0B / 810B / 184B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 29 | 0.0579 | 2010/03/30 13:11:47 | 0B / 11B / 15B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 139 | 2.5472 | 2010/03/31 13:01:11 | 0B / 81B / 53B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Zsh | zzo38(post-mortem) | 10 | 10000 |
2 | sed | zzo38 | 11 | 9090 |
3 | Bash | msk | 12 | 8333 |
4 | Vim | nn | 29 | 3448 |
5 | Perl | Sisyphus | 37 | 2702 |
6 | Ruby | yvl | 87 | 1149 |
7 | AWK | nn | 92 | 1086 |
8 | Groovy | nn | 139 | 719 |
9 | JavaScript | nn | 220 | 454 |
10 | D | 51b | 221 | 452 |
11 | C | nn | 223 | 448 |
12 | Postscript | yshl | 728 | 137 |
return to the top page