Thread String bis zu einer bestimmten Stelle auslesen
(4 answers)
Opened by jojodier at 2012-11-20 12:08 Code: (dl
)
1 data-docAttribution="Rockstar Games, Inc." Sehe ich es richtig, daß ein absnitt immer <name>="<wert>" ist? Ungetestet: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 my $data='data-docAttribution="Rockstar Games, Inc."data-docConsumptionUri=""data-docId="com.rockstar.gta3ger"data-docTitle="Grand Theft Auto 3" data-docIconUrl="https://lh4.ggpht.com/"'; my %values; while(lenght($data)) { if($data=~s/^.*?([^\s=]+)\s*=\s*"([^"]*)"\s*//s) { $values{$1}=$2; } else { last } } print $values{'data-docTitle'}."\n"; |