Posts by HuntressDC • 19 points
3 posts
-
-1
votes0
answers23
viewsQ: Regex to get a dd/MM/yyyy date by ignoring characters in the middle?
In this case I can have a string like String data = "20/dsauh'03*/2021"; My idea was to do something like: Pattern p = Pattern.compile("([0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4})"); Matcher matcher =…
-
0
votes0
answers25
viewsQ: Remove characters from a String (or generate a new one without them) that are between two special characters
I need some help in this case, I have a string and I would need to remove some characters from it. String minhaStr = "{"abcde{"fg":"hij"}" I need to remove everything between the keys {, ie in this…
-
1
votes1
answer72
viewsQ: Regex for a valid YYYY year in java?
I am using these regular expressions for a future date check: Pattern padraoDia = Pattern.compile("([1-9]|0[1-9])|[1-2][0-9]|3[0-1]"); Pattern padraoMes = Pattern.compile("(0[1-9]|[1-9])|1[0-2]");…