regex to remove all text before a character

前端 未结 6 1035
孤独总比滥情好
孤独总比滥情好 2020-12-13 06:46

Is there an easy way to remove all chars before a \"_\"? For example, change 3.04_somename.jpg to somename.jpg.

Any suggestions for where t

6条回答
  •  没有蜡笔的小新
    2020-12-13 07:09

    I learned all my Regex from this website: http://www.zytrax.com/tech/web/regex.htm. Google on 'Regex tutorials' and you'll find loads of helful articles.

    String regex = "[a-zA-Z]*\.jpg";
    System.out.println ("somthing.jpg".matches (regex));
    

    returns true.

提交回复
热议问题