RegEx length limit?

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

RegEx length limit?

Postby complicity » Sat Aug 10, 2002 3:51 am

Is there a limit to the length of a regular expression, or some other limitation that I am not aware of? Because sometimes I cannot enter an expression in... for example...

This will take:
(.*\.((JPG)|(MPG)|(MPEG)|(JPEG)|(AVI)|(WMV)))|\([0]+/[0-9]\)

This will not:
(.*\.((JPG)|(MPG)|(MPEG)|(JPEG)|(AVI)|(WMV)))|\([0]+/[0-9][0-9]?[0-9]?\)

Or am I just doing something wrong?

I have other ones that didn't work, but I can't remember the exact syntax.

Even if I edit the filter.xml file, it doesn't appear in NewsBin, although it still shows in the file if I close NB and re-open the xml.

NewsBin 4.01 build 3836, btw
complicity
n00b
n00b
 
Posts: 3
Joined: Sat Aug 10, 2002 3:52 am

RE: RegEx length limit?

Postby dexter » Sat Aug 10, 2002 8:57 am

Quade can look up the length limit but in this case, I think our RegEx parser doesn't handle the ? expression. I'll play with it and see.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

RE: RegEx length limit?

Postby complicity » Sat Aug 10, 2002 12:27 pm

I thought that may have been the problem as well, but it says it handles it on this page www.newsbin.com/regexp.htm and also, I have other expressions which use it and they work. They are also longer, which is strange.

Here is one using ? that works, or at least that NB accepts (and it's also longer)...

(.*\.((RAR)|(PAR)|(NFO)|(SFV)|(ZIP)|([P-Z][0-9][0-9])|([0-9][0-9][0-9])))|\([0]+/[0-9][0-9]?[0-9]?\)
complicity
n00b
n00b
 
Posts: 3
Joined: Sat Aug 10, 2002 3:52 am

RE: RegEx length limit?

Postby Quade » Sat Aug 10, 2002 2:31 pm

While this doesn't answer the question, since it's going into the filters.xml, why not add it as multiple lines worth of regex?
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44984
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

RE: RegEx length limit?

Postby complicity » Sat Aug 10, 2002 6:40 pm

Well, that's what I HAVE done, I'm just wondering why certain combinations of regex don't seem to take, since it now seems not to necessarily be tied to the length of the expression... curious...

I'll get over it. Image link not allowed for unregistered users
complicity
n00b
n00b
 
Posts: 3
Joined: Sat Aug 10, 2002 3:52 am


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests