mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 414
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
I trying some think like that /^[a-z]{6}|[a-z]{10}$/ but it work like /^[a-z]{6,}$/ ;] I need to match only 6 or 10..

Can anyone explain me why it work like that.. And make it works correctly ?


mIRC Chm Help 6.16.0.3 Full Anchored!
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/^([a-z]{6}|[a-z]{10})$/ or /^[a-z]{6}$|^[a-z]{10}$/

Joined: Apr 2003
Posts: 414
Fjord artisan
OP Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Yap.. That was easy.. Now i understand the mistake wink Thank you.


mIRC Chm Help 6.16.0.3 Full Anchored!
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
And unless you're using $regml or $regsub to backreference, you should use:
/^([color:blue]?:[a-z]{6}|[a-z]{10})$/[/color]

Just a bit faster, telling the regex engine to group but not backref.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard