Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Replace a string that contains special characters

by kennethk (Abbot)
on Mar 21, 2017 at 16:00 UTC ( [id://1185364]=note: print w/replies, xml ) Need Help??


in reply to Replace a string that contains special characters

Please note that it's helpful to wrap inputs and outputs in code tags, in addition to code itself. Whitespace gets mangled and pairs of square brackets linkify content.

Given that it looks like you are dealing with JSON, using the JSON module is probably the clean solution. You can parse the JSON, delete the offending keys, and then reserialize. It's not clear to me how one identifies the offending elements -- can you characterize the traits of the objects you wish to remove?


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re: Replace a string that contains special characters

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2025-06-20 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.