Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Help with a Regex

by kwaping (Priest)
on May 06, 2005 at 17:59 UTC ( [id://454745]=note: print w/replies, xml ) Need Help??


in reply to Help with a Regex

This is close, but doesn't work for every case. Maybe someone else can build upon this to find the correct answer.
#!/usr/bin/perl -w use strict; my @a = ('M','D','C','L','X','V','I'); my $out = ''; my $n = 0; my $b = 'XIV'; my @tmp = split(//,$b); for (my $i = 0; $i < @a; $i++) { if ( $a[$i] eq uc($tmp[$n]) ) { $out .= $a[$i]; $n++; } else { $out .= '.'; } } print $out; exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://454745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found