Page 1 of 1

Runtime error '13' : type mismatch

Posted: 21 Mar 2006 18:22
by j_c_hallgren
Ok...so I was getting bold and adventurous...so I tried to do a RegEx find..
I musta made a BIG boo-boo cause I got an error.."Unexpected Quantifier. Ensure your search pattern is properly constructed"...fine...but then after clicking on that, I get a "Runtime error 13" and the name and location boxes get cross-hatching...and then as usual, XY exits out...

The failing RegEx entry was ">*.(bmp|jpg)"

Re: Runtime error '13' : type mismatch

Posted: 21 Mar 2006 23:59
by RalphM
j_c_hallgren wrote:Ok...so I was getting bold and adventurous...so I tried to do a RegEx find..
I musta made a BIG boo-boo cause I got an error.."Unexpected Quantifier. Ensure your search pattern is properly constructed"...fine...but then after clicking on that, I get a "Runtime error 13" and the name and location boxes get cross-hatching...and then as usual, XY exits out...

The failing RegEx entry was ">*.(bmp|jpg)"
Well there are a couple of differences between standard search patterns and RegExp ones, following the RegExp meanings:

. (dot) Matches any single character except line break characters \r and \n.
* (star) Repeats the previous item zero or more times.

So, you actually used the repeat char before there wasn't anything to repeat.

Try this one instead, which worked here: ">.*(bmp|jpg)"

Posted: 22 Mar 2006 00:08
by j_c_hallgren
RalphM, so that would be proper RegEx to look for all .BMP and .JPGs?
I'm wanting to combine "*.bmp" and "*.jpg" patterns...

It seems to find other files with JPG and BMP as part of name and not an extension...that was my goal...and I didn't see any example that appeared to match this type of search...

In any case, it shouldn't really "crash & burn" if a bad regex is input...

Posted: 22 Mar 2006 09:35
by admin
j_c_hallgren wrote:In any case, it shouldn't really "crash & burn" if a bad regex is input...
Damn it, no it shouldn't! Just fixed it, thanks!

RegExp pattern (as given by RalphM): >.*(jpg|bmp)
Boolean pattern: *.jpg | *.bmp

Posted: 22 Mar 2006 10:10
by j_c_hallgren
Seems that regex needs a tweak to be more similar to boolean results..
>.*(.bmp|.jpg)
Had to add a "." before the extensions to avoid finding it within the name...as in tbmpadding.txt would have matched before...however, I still get undesired matches on text.jpg-somename.xyz style names...

Posted: 22 Mar 2006 10:18
by admin
Me speak no RegExp --- others may help!

Posted: 22 Mar 2006 15:46
by j_c_hallgren
:x Ok, so I'm NOT really mad...was just a bit irritated...I somehow managed to get that bad regex saved so that when I tried to close 2nd tab, it would then contantly crash on tab 1! :o
I looked in the INI file but didn't see the regex...ok...so where would it be hiding? :?

Ah-ha! Saw the FindTemplates folder...maybe there?..yes! Found the regex in tab_2.dat! So edited it to a valid string and all is well... :)

Posted: 23 Mar 2006 17:19
by jacky
here's the beast ;)
>.*(.bmp|.jpg)$

$ means end of line, so we used it to specify there's nothing more after (.bmp|.jpg)

FYI the other way around ^ is the sign for beginning of line, so:
>^toto
should match all file starting with toto (like toto*)

Posted: 23 Mar 2006 17:54
by j_c_hallgren
8) Thanks jacky!

I'd also suggest that this simple boolean example be added to Help file and/or XED page as a real-world usage...adding the regex might be good too...

Posted: 23 Mar 2006 18:11
by admin
jacky wrote:here's the beast ;)
>.*(.bmp|.jpg)$
Not quite: it also finds "filejpg" but should only find "file.jpg". The dot must be escaped:
>.*(\.bmp|\.jpg)$