我可以使用apache poi读取excel表格列吗?(不使用行迭代器)
for (Row row : sheet) {
Cell firstCell = row.getCell(0);
// Printing Stuff
}
Run Code Online (Sandbox Code Playgroud)
我知道,上面的也会这样做.但是我需要在不使用Row Iterator的情况下获得第一列的数据.
我可以使用什么regex/pattern来查找字符串中的以下模式?
#nnnn:
Run Code Online (Sandbox Code Playgroud)
nnnn可以是任何 4 位长数字,只要它由主题标签和冒号包围即可。
我已经尝试过下面的代码:
#nnnn:
Run Code Online (Sandbox Code Playgroud)
它确实有效,但它匹配其他字符串,如下所示:
String string = "#8226:";
if(string.matches( ".*\\d:.*" )) {
System.out.println( "Yes" );
}
Run Code Online (Sandbox Code Playgroud)
我希望它只匹配问题顶部的模式。
谁能告诉我我哪里错了?