Home
About
Download
Register
News
Help
Register
Log In
Forums
Scripts & Popups
Regex match exactly n times or exactly n1 times ?
Forums
Active Threads
Search
Who's Online
Help
Print Thread
Regex match exactly n times or exactly n1 times ?
#
69839
31/01/04
05:02 PM
A
Adrenalin
Adrenalin
A
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 ?
Copy Link to Clipboard
Re: Regex match exactly n times or exactly n1 times ?
#
69840
31/01/04
05:20 PM
Joined:
Dec 2002
Posts: 3,015
London, UK
C
Collective
Hoopy frood
Collective
Hoopy frood
C
Joined:
Dec 2002
Posts: 3,015
London, UK
/^([a-z]{6}|[a-z]{10})$/
or
/^[a-z]{6}$|^[a-z]{10}$/
Copy Link to Clipboard
Re: Regex match exactly n times or exactly n1 time
#
69841
31/01/04
05:34 PM
A
Adrenalin
Adrenalin
A
Yap.. That was easy.. Now i understand the mistake
Thank you.
Copy Link to Clipboard
Re: Regex match exactly n times or exactly n1 time
#
69842
31/01/04
06:04 PM
Joined:
Feb 2003
Posts: 2,737
R
Raccoon
Hoopy frood
Raccoon
Hoopy frood
R
Joined:
Feb 2003
Posts: 2,737
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.
Copy Link to Clipboard
Hop To
News and Discussions ------
Latest News
General Discussion
Support ------
mIRC Help
Connection Issues
Scripts & Popups
Development ------
Feature Suggestions
Developers
Bug Reports
Print Thread
Switch to Threaded Mode
Show Likes
Link Copied to Clipboard
View Profile
Private Message
Follow User
Forum Posts
View Profile
Private Message
Follow User
Forum Posts
Forum Rules
·
Mark All Read
Contact Us
·
Help
·
mIRC Homepage