in reply to Re: Peeling Data with Reserved Characters and Long Lines
in thread Peeling Data with Reserved Characters and Long Lines

davido:

I really liked your third method, but you didn't use the 5-20 character bit of the specification:

$ cat t.pl #!/usr/bin/perl use strict; use warnings; local $/ = '?srt='; while (<DATA>) { chomp; print "$1\n" if m[-/(\w{5,20})$]; } __DATA__ ...emable-Stuff-10100-PTZ-/1280640AB018292?srt=More2stuff&ha... ...wer-Idaptx-SJ10-/35DE4715844?srt=L12_Defa43Dom.. foo-/a?srt=bar;foo-/abcdefghijklmnopqrstuvwxyz?srt= foo-/abcde?srt=bar-/abcdef?srt=baz-/abcdefg?srt= $ perl t.pl 1280640AB018292 35DE4715844 abcde abcdef abcdefg

...roboticus

When your only tool is a hammer, all problems look like your thumb.