Answer the question
In order to leave comments, you need to log in
How to find a specific number of / in a string in java?
Good afternoon! Please help me create a template for searching for links with two slashes, for example:
site/dir1/
But this type of link is not needed:
site/dir2/example/
Did ". */.*/"
But the links from my first example also come to true and from the second. I tried to simply search by the number / , so that 2 in the line was and not 3 and registered "/ {2}" But it gives an error. Already a lot of things googled but did not find a solution to the nuance.
help me please
Answer the question
In order to leave comments, you need to log in
A dot is any character, incl. and slash.
You need something like [az]+
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question