Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How do I replace certain character if condition exists

by kilinrax (Deacon)
on Apr 17, 2003 at 13:14 UTC ( #251185=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    abowley@krait:~$ (echo 'Madrid(Spain' && echo 'Madrid(Spain)') | perl 
    +-pe 's/\((?![^)]*\))/ /g;'
    Madrid Spain
    Madrid(Spain)
    
  2. or download this
    s/
      \(      # an open bracket
    ...
        \)    # followed by a bracket
      )
     / /gz;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2022-05-16 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (62 votes). Check out past polls.

    Notices?