Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Replace a string that contains special characters

by kennethk (Abbot)
on Mar 21, 2017 at 16:00 UTC ( #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
Node Status?
node history
Node Type: note [id://1185364]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2017-09-23 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (272 votes). Check out past polls.

    Notices?