Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: String matching problem

by cool (Scribe)
on May 08, 2007 at 11:29 UTC ( #614118=note: print w/replies, xml ) Need Help??


in reply to String matching problem

I hope you mean the very last digit of a line, not the last digit of '-' pattern.
#! /usr/bin/perl use warnings ; use strict; open(FH,"infile") or die "File cant be opened\n"; while (<FH>) { if (m/\d-(\d)"$/) { print "$1\n"; } }
Infile
"1-2, 3-4, 5-6" or "1%5, 3-4" or "1-2" A6 12

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-02-17 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?