正则匹配‘[数字]’

来源:互联网 发布:武侠电影 知乎 编辑:程序博客网 时间:2024/05/22 21:31
package regular;/** * Created on 2017/6/19 * Author: youxingyang. */public class Test {    public static void main(String[] args) {        String a = "[3] Heider, E.R.& D.C.Oliver. The structure of color space in naming and memory of two languages [J]. Foreign Language Teaching and Research, 1999, (3): 62 – 67.";        String regular = ".*\\[[0-9]+\\].*";        System.out.println(a.matches(regular));    }}
原创粉丝点击