Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 John Coltrane plays...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2018-07-16 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (341 votes). Check out past polls.

    Notices?