Replace everything between >< tags

Posted on 2012-09-13
Last Modified: 2012-09-13
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
Question by:NeilT
    LVL 30

    Expert Comment

    by:Marco Gasi
    Which language or tool are you using for this?
    LVL 30

    Accepted Solution

    Using php you can use this:

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

    where $subject is your xml content.

    LVL 3

    Author Closing Comment


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
    Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now