You specified "\w{3}-\w{2}", which says to take 3 word characters followed by a dash followed by 2 word characters. "est-te" seems right. You might need something like "(\w{3})\w*-(\w{2})". You would need to combine the groups in the matches.
Regex Problem
Fer Trob
1
Reputation point
Hello, I have a question in Regex that I believe is easy to solve, anybody can help me?
I need to get the first 3 characters of that string ("newtest-test"), the dash and the 2 characters after the dash (like that "new-te").
I use this regex "\w{3}-\w{2}" but return "est-te". What's wrong?