Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: RegEx needed

by krujos (Curate)
on Dec 31, 2002 at 15:50 UTC ( #223350=note: print w/ replies, xml ) Need Help??


in reply to Efficient trimming of trailing whitespace from array elements?

perldoc has a few answers to this too, you should check them out. This should work for you though.

s/(\s+)$//;


Comment on Re: RegEx needed
Download Code
Re: Re: RegEx needed
by Juerd (Abbot) on Dec 31, 2002 at 15:53 UTC

    s/(\s+)$//;

    You can leave out the parentheses. (Unless you need $1, but you don't, in this case)

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-07-07 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls