Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to avoid the duplication in a string

by jonadab (Parson)
on Oct 22, 2008 at 11:39 UTC ( #718708=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to avoid the duplication in a string
in thread How to avoid the duplication in a string

could you please explain what is the meaning for \1+ in perl

In regular expressions, backslashed numeric digits are references back to the preceding captures. So \1 refers to the same thing that was captured in the first set of parentheses, and \2 refers to the same thing that was captured in the second set, and so forth.

As for the +, it modifies a backreference in exactly the same way it modifies any other atom in a regular expression.

-- 
We're working on a six-year set of freely redistributable Vacation Bible School materials.
  • Comment on Re: How to avoid the duplication in a string

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://718708]
help
Chatterbox?
[SuicideJunkie]: So, possibly interesting thing; I had that script which was using more than all the ram to open an absurdly large spreadsheet. I set it up to spin overnight nightly, so it stopped releasing memory since it was never fully exited.
[SuicideJunkie]: Didn't expect that to be a problem. There's plenty of disk space for swap, and the memory space would be reused the next day. But apparently virtualbox dies with a guru meditation when there's no physical memory unused on start.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2017-04-26 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (491 votes). Check out past polls.