Help for this page

Select Code to Download


  1. or download this
    <tag1>[abcd]</tag1>Blah, blah, blah?: <tag2>Yes</tag2>
    <tag1>[efgh]</tag1>Yadah, yadah?: <tag2>1) Foo;
    ...
    <tag1>[ijkl]</tag1>Blah?: <tag2>Yes</tag2>
    <tag1>[mnop]</tag1>Blah, bleh?:  <tag2>Yes, I will.
    If this and that</tag2>
    
  2. or download this
    #!/usr/local/bin/perl -w
    open (DATA, "data.txt") or die "Error";
    ...
    while ( $body =~ /<tag1>\[(\w+)\]<\/tag1>.*<tag2>(.*)<\/tag2>/g ) {
        print "[$1] => [$2]\n";
    }
    
  3. or download this
    [abcd] => [yes]
    [efgh] => [1) Foo; 2) Bar; Quux;]
    [ijkl] => [Yes]
    [mnop] => [Yes, I will. If this and that.]