This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

regexp help

Old posts that have not been replied to for several years.
Locked
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

regexp help

Post by ShavdApe »

([\da-zA-Z]"{1}")(\1[\da-zA-Z]{3})

The above regex will match when a character is repeated 5 times or more in sucsession. eg.
Hellooooo
Or at least it will in regexbuddy and in a quick test in mirc but when i try to use the same as a regexp it matches when there are 2 or more so Hello

Any help appreciated.

** [EDIT]

On further testing looks like my regex was wrong to start with hehe and the eggdrop was doing what it was told.
if you hadnt already guessed im new to regex ;)

([\da-zA-Z]{1})(\1{3,}) <--- is the one im trying now
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

% regexp {(\w)(\1{4,})} hellllo
0
% regexp {(\w)(\1{4,})} helllllo
1
Have you ever read "The Manual"?
D
DayCuts
Voice
Posts: 37
Joined: Tue Jun 15, 2004 8:43 am

Post by DayCuts »

(\d|\w)(\1{4,}) = any word charactor or digit 5 or more times
(.)(\1{4,}) = any charactor at all 5 or more times

edit: guess we were posting at same time :\

Here is a nice website with good guides to regular expressions...
http://www.regular-expressions.info/
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Good info guys, this is helpful for me too! :mrgreen:
I am really weak with regular expressions as well as regular substitutions. :roll:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

tip

Post by user »

DayCuts wrote:(\d|\w)(\1{4,}) = any word charactor or digit 5 or more times
\w includes \d
Have you ever read "The Manual"?
D
DayCuts
Voice
Posts: 37
Joined: Tue Jun 15, 2004 8:43 am

Post by DayCuts »

Your right, i was confusing regex flavors, tcl does include the digits and underscore in \w but there are some dont.
Locked