Java Regular Expression not working for this special use case
The following is my code:
Why its not working Pattern p = Pattern.compile(“*.123”); while Pattern p = Pattern.compile(“.*.123”); works? [duplicate]
This question already has answers here: Regular Expressions- Match Anything (17 answers) Reference – What does this regex mean? (1 answer) Closed 48 secs ago. I want to know why in Pattern.compile() method Pattern p = Pattern.compile(“*.123”); does not work while Pattern p1 = Pattern.compile(“.*.123”); works? java regex pattern-matching 0
Regex for checking max allowed character length and for having specific max number of lines
im trying to create a regex pattern check where the input line contains specific max characters (5) in length and there are max allowed number of lines is 10.
Each of these 10 lines needs to follow this max characters check of 5.