in reply to Newbie RegEX question

Something like this:
my( $serial, $name, $category ) = $filename =~ /^(\d+)([A-Z][a-z]*)([A-Z][a-z]*)/;
Or if you want to use the POSIX character classes:
my( $serial, $name, $category ) = $filename =~ /^(\d+)([[:upper:]][[:lower:]]*)([[:upper:]][[:lower:]]*)/;

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Replies are listed 'Best First'.
Re^2: Newbie RegEX question (posix charclass syntax)
by Aristotle (Chancellor) on May 13, 2003 at 14:57 UTC
    Have you ever used them? The character classes you use will any of the characters in :epru and :elorw respectively. POSIX classes are used like this:
    /^(\d+)([[:upper:]][[:lower:]]*)([[:upper:]][[:lower:]]*)/;

    Makeshifts last the longest.