Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

Replace everything between >< tags

Hi, I have some XML that I need to post online but all the contents is sensitive so I need to remove, I'd like to easily remove everything between the tags >< using regex if possible
0
Neil Thompson
Asked:
Neil Thompson
  • 2
1 Solution
 
Marco GasiFreelancerCommented:
Which language or tool are you using for this?
0
 
Marco GasiFreelancerCommented:
Using php you can use this:

$result = preg_replace('/(?<=>).*(?=<)/si', 'cacca', $subject);

where $subject is your xml content.

Cheers
0
 
Neil ThompsonSenior Systems DeveloperAuthor Commented:
cheers
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now