Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Pattern Matching

by davidas (Initiate)
on Mar 17, 2017 at 21:41 UTC ( [id://1185085]=note: print w/replies, xml ) Need Help??


in reply to Re: Pattern Matching
in thread Pattern Matching

Thanks. I'll have a good play about with this. I didn't go the CPAN module route because of the requirement to match leading and trailing brackets, period and spaces, which I thought would be more specific to my particular requirement - ironically that's not what caused the problem though !

Replies are listed 'Best First'.
Re^3: Pattern Matching
by AnomalousMonk (Archbishop) on Mar 19, 2017 at 01:06 UTC
    ... the requirement to match leading and trailing brackets, period and spaces ...

    I had in mind using a CPAN module only as a source for a regex for dependably recognizing the Roman-numeric part of your string, something along the lines of what Regexp::Common provides. Unfortunately, this module does not seem to support Roman numerals.

    Ok, then maybe use the Roman-to-decimal conversion functions of Roman or Text::Roman (but I've not used either of these modules and so can't recommend them) or some such to test for the 1 .. 39 range of a Roman sequence extracted with a simple  [ivxIVX]+ capture. The advantage of using such a module is that it is, one presumes, well-tested. (These modules both provide an  isroman() function that would, one would hope, reject something like ixixixix, but I haven't checked this.)

    But if you have to do all that, maybe it's better to hand-craft (and test!) your own  [i-xxxix] regex...


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-25 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found