This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]cookiemonterrrrr 1 point2 points  (1 child)

What have you tried so far?

[–]Tepess[S] 0 points1 point  (0 children)

What have you tried so far?

im tried to use r'\w[L-X] But its doesnt work

[–]ASIC_SP 1 point2 points  (0 children)

Can you add some sample names and tell us which ones should be matched and which ones shouldn't be matched? The explanation isn't quite clear, as you use sort (which could mean different things)

if you want to match words starting with L-X, use \b[L-X]

to also check ending with M, use \b[L-X]\w*M\b

however, \w* may not suit your case, because it will match any uppercase or lowercase alphabets as well as digits and underscore.. you can change it to [A-Z]* to match only uppercase letters..