in reply to Re: calculating lines
in thread calculating lines

how do i remove the punctuation and whitespace characters too?

Replies are listed 'Best First'.
Re^3: calculating lines
by Zaxo (Archbishop) on Jan 12, 2007 at 01:15 UTC

    Just use another character class than \s. Non-word, \W, might be what you want.

    If all else fails you can make a custom character class with square brackets. See perlre, the regex doc.

    After Compline,
    Zaxo

Re^3: calculating lines
by Yoda_Oz (Sexton) on Jan 12, 2007 at 01:17 UTC
    never mind, worked it out...
    s/\s+//g; s/$\s//; s/([\041-\057]|[\72-\100]|[\133-\140]|[\173-\176])+//g; print lc;