PDA

View Full Version : RegEx



NewsArchive
09-07-2010, 01:21 AM
Hi Friedrich,

how can I check with "if RegExp", wether a string contains two or more
sequent back slashes, except the first two letters?

Examples:

\\ -> FALSE
\\\ -> TRUE
\\a -> FALSE
\\a\ -> FALSE
\\a\\ -> TRUE
\\a\\b -> TRUE
\\a\\\b -> TRUE
\\a\b\ -> FALSE
\\a\b\\ -> TRUE
\\a\\b\\ -> TRUE

I know, I can cut the first character and then check with "contains \\",
but we have this nice regex feature...

Unfortunaltely, I wasn't able to find an expression, which works with
all the above test cases.

I thougt it should work with the following expression, but it didn't:

^.\\\\.*$


Markus

NewsArchive
09-07-2010, 01:22 AM
Hi Markus,

> Unfortunaltely, I wasn't able to find an expression, which works with all
> the above test cases.
>
> I thougt it should work with the following expression, but it didn't:
>
> ^.\\\\.*$

I have to check this and play with the function. We are using a "basic"
RegEx technique in SB7 (a full implementation would be an overkill here and
blow up the size of the runtime).

Friedrich

NewsArchive
09-07-2010, 01:22 AM
..+\\\\

Basically, at lease one character but maybe more (.+), then two back
slashes. This will ignore the first character, and search for all
double backslashes after that.

Mike Hanson
www.boxsoft.net

NewsArchive
10-21-2010, 12:53 AM
Hi Friedrich,

are there any news about this?

Markus

NewsArchive
10-21-2010, 12:53 AM
Hi Markus

>
> are there any news about this?
>

Yes, this does not work in the RegEx implementation that is used in the
SetupBuilder runtime. We'll see if it is possible to make improvements in
this area. Unfortunately, it's impossible to add a fully featured RegEx
because the overhead would (at least) double the size of the runtime.

Friedrich

NewsArchive
10-24-2010, 07:26 AM
Markus,

> I thougt it should work with the following expression, but it didn't:
>
> ^.\\\\.*$

I tried the Ruby regular expression editor to test the above regular
expression but I think your expression can't be used to do what you want.

http://rubular.com/

Friedrich

NewsArchive
10-25-2010, 12:48 AM
Hi Friedrich,

thank you for this great link. You are right, there was an error in my
regex. The correct regex (verified with the rubular site) is:

^.+\\\\.*$

Unfortunately, it doesn't work with SB.

Markus

NewsArchive
10-25-2010, 12:48 AM
Hi Markus,

> thank you for this great link. You are right, there was an error in my
> regex. The correct regex (verified with the rubular site) is:
>
> ^.+\\\\.*$
>
> Unfortunately, it doesn't work with SB.

Yes, I also noticed this when I tested your examples. We are already
working on this. It has something to do with the code that processes the
'\'.

Thanks,
Friedrich

NewsArchive
10-27-2010, 12:38 AM
Markus,

> ^.+\\\\.*$
>
> Unfortunately, it doesn't work with SB.

We have rewritten and enhanced the RegEx engine. This will be part of the
upcoming SB73.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-06-2011, 01:21 PM
OK in 3313

Markus Zander

NewsArchive
05-06-2011, 01:21 PM
>
> OK in 3313
>

Thank you.

Friedrich