Java; String replace (using regular expressions) ?

Java; String replace (using regular expressions) ?

Asked on January 4, 2019 in Regex.
Add Comment


  • 2 Answer(s)

    using regular expressions Java; String replace:

    str.replaceAll("\\^([0-9]+)", "<sup>$1</sup>");
    
    

     

    Answered on January 4, 2019.
    Add Comment

    Java; String replace using regular expressions for this use below code:

    String input = "hello I'm a java dev" +
    "no job experience needed" +
    "senior software engineer" +
    "java job available for senior software engineer";
     
    String fixedInput = input.replaceAll("(java|job|senior)", "<b>$1</b>");
    
    Answered on January 4, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.