Help for this page

Select Code to Download


  1. or download this
    use strict;
    use WWW::Mechanize;
    ...
    $text =~ s/<[^>]*>//g;              # Strip HTML tags
    $text =~ s/(?<!\n)\n(?!\n)/ /mg;    # Combine lines
    $text =~ y/ //s;                    # Squash multiple spaces
    
  2. or download this
    my $len;
    $text =~ s/((\S+)(?=\n|\s)|\n)/     # Reformat plain text
    ...
                    $1
               }
              /mge;
    
  3. or download this
    # after some playing around, I came up with the
    # following regex that does wrapping at column
    ...
    $text =~ s/(.{50,60}(?<=\s\b))/$1\n/mg;
    
    print "$text\n";
    
  4. or download this
    START's reply
    
    ...
    at the neural level. Current work focuses especially on
    understanding the role of vision, language, and motor
    computation in general intelligence.