mentionPattern does not match names that end in `-`
See original GitHub issuePeople who’s names end in -
can’t be pinged.
After messing around a bit, I think this is due to the \b
word boundary matching. As -
is not a word character, a space can never match after it (word boundary requires word before and non-word after, or vice versa). You can still ping these people if you put a letter directly after the -
in order to trigger the word boundary matching.
Pattern p = Pattern.compile("\\b(" + "Box-" + ")\\b", CASE_INSENSITIVE);
Matcher m = p.matcher("I'm Box-");
System.out.println(m.find());
// Prints "false"
Matcher m2 = p.matcher("I'm Box-x");
System.out.println(m2.find());
// Prints "true"
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
docs incorrectly mention pattern matching works like ...
the docs and explain that pathname matching is not possible in bash, i.e. there is no ... i.e. "ls", would NOT match that...
Read more >Regex to not Match Names - Stack Overflow
So my forum allows me to use a regex to allow certain user names registration, but I want to do that ...
Read more >Comparing a list with names that not match
Hello, I need to compare data from 2 sheets (highlighted in blue) with the following challenges: List 1 contains who got access to...
Read more >300 Popular Boy and Girl Baby Names Ending in A, N, and Y
Find the perfect name ending in A, N, or Y for your baby girl or boy. Some of the most popular will fit...
Read more >How to Fix: names do not match previous names in R
In this article, we are going to solve the error “names do not match previous names” in R Programming Language.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I was able to fix it
@Askaholic this pattern matches on just spaces as did @1-alex98. So this is not trivial it seems