Guest User

Regexp for numerals

a guest
Jan 15th, 2012
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl -nw
  2. chomp;
  3. if (/^
  4.     (?'c1'C)? M?                     (?('c1')|(?'c2'C)?) D?
  5.     (?'x1'X)? (?('c1')|(?('c2')|C?)) (?('x1')|(?'x2'X)?) L?
  6.     (?'i1'I)? (?('x1')|(?('x2')|X?)) (?('i1')|(?'i2'I)?) V?
  7.     (?('i1')|(?('i2')|I?))           $/x) {
  8.   print; print "\n";
  9. }
RAW Paste Data