/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Pattern;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String t1
= "/aluno/1/Teste dos Testes/1"; String t2
= "/aluno/1/Teste dos Testes/1,23,456,789"; String t3
= "/aluno/1/Teste dos Testes/1,"; String t4
= "/aluno/1/Teste dos Testes/1,23,456,789,"; Pattern pattern = Pattern.compile("/aluno/\\d+?/\\D+?/(\\d+?,)*?\\d+");
System.
out.
println(pattern.
matcher(t1
).
matches()); //true System.
out.
println(pattern.
matcher(t2
).
matches()); //true System.
out.
println(pattern.
matcher(t3
).
matches()); //false System.
out.
println(pattern.
matcher(t4
).
matches()); //false }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguUGF0dGVybjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU3RyaW5nIHQxID0gIi9hbHVuby8xL1Rlc3RlIGRvcyBUZXN0ZXMvMSI7CgkJU3RyaW5nIHQyID0gIi9hbHVuby8xL1Rlc3RlIGRvcyBUZXN0ZXMvMSwyMyw0NTYsNzg5IjsKCQlTdHJpbmcgdDMgPSAiL2FsdW5vLzEvVGVzdGUgZG9zIFRlc3Rlcy8xLCI7CgkJU3RyaW5nIHQ0ID0gIi9hbHVuby8xL1Rlc3RlIGRvcyBUZXN0ZXMvMSwyMyw0NTYsNzg5LCI7CgkJU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