Switch to full style
General Java code examples
Post a reply

java regular expression

Sun May 09, 2010 6:49 pm

Following java regular expression example show you how to use replace a string with a regular expression .Here am removing the start part of xml whichis something like this :
Code:

<?xml version="1.0" encoding="UTF-8"?>



using the following function
Code:

    
public String clearXMLHeader(String strXML)
    {
     
        
String regExp "[<][?]\\s*[xml].*[?][>]";
        
strXML=strXML.replaceFirst(regExp "");
        return  
strXML;
    }
 




Post a reply
  Related Posts  to : java regular expression
 email adress validation and regular expression     -  
 evaluate XPath Expression from XML file     -  
 Regular Expressions and Patterns     -  
 String replace with Regular Expressions     -  
 2d game in java-Monster-Java 2D Game Graphics and Animation     -  
 What is Java API?!!!     -  
 java or .net     -  
 need help in java     -  
 Using FTP in java     -  
 Java course     -  

Topic Tags

Java Regular Expression, Java Strings