1
votes

I need to create a pattern that will include _ symbol. I've tried this:

Patternpat= Pattern.compile("[a-z0-9]([_]){5,17}");

But it didn't work. Is there a way to add this symbol to the pattern?

Use [a-z0-9_]{5,17} - anubhava
can you add the text input and what are you waiting? - Alejandro Gonzalez
You add a _ by adding a literal _, nothing else. It's not clear what you're trying to achieve here. Please clarify with some strings you would like to match, and some strings you want to not match. - user229044