html - Comparing the excel cell value while importing in spring -
I am importing Excel data using HTML, Spring and Apache POI APIs. I need some assumptions before saving the data. For a cell, I need to check that its value is greater than 01 and less than 32. I
cell .getStringCellValue () Have seen like regex;
I have used this in a solution like this
if (cell.getStringCellValue (.) Matches ("\ b ([1-9 ] [12] [0-9] | 3 [01]) \ b "))
But as I read, using regExp to compare numbers is a good idea No, it's mainly for strings.
So my question is, is there a better way to solve my problem, to find out whether the cell value comes within a range or not
You must add [1- 9] before
. 0
to 01
to
In order to match the number limit of <09>
\ b (0 [1-9] | [12] [0-9] | 3 [01]) \ b
Comments
Post a Comment