B
Beno
how to remove the string part between the two marks
for example
from string "<DIV> </ DIV> <SPAN ID=TIME> 12:30 </ SPAN> <SOME TEXT>"
extract the text "12:30"
I succeeded so I made the first split the string with the word
<SPAN ID=TIME> then again split the string with the word </ SPAN>
works but is complicated:
$ string = "<DIV> </ DIV> <SPAN ID=TIME> 12:30 </ SPAN> <SOME TEXT>";
@ part1 = split (/ <SPAN ID=TIME> /, $ string);
@ part2 = split (/ <\ / SPAN> /, $ part1 [0]);
print part2 [0];
I know that there is an easier way in Perl, but how?
Please help.
Thanks.
Beno
for example
from string "<DIV> </ DIV> <SPAN ID=TIME> 12:30 </ SPAN> <SOME TEXT>"
extract the text "12:30"
I succeeded so I made the first split the string with the word
<SPAN ID=TIME> then again split the string with the word </ SPAN>
works but is complicated:
$ string = "<DIV> </ DIV> <SPAN ID=TIME> 12:30 </ SPAN> <SOME TEXT>";
@ part1 = split (/ <SPAN ID=TIME> /, $ string);
@ part2 = split (/ <\ / SPAN> /, $ part1 [0]);
print part2 [0];
I know that there is an easier way in Perl, but how?
Please help.
Thanks.
Beno