-
RegEx
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
-
Re: RegEx
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
-
Re: RegEx
..+\\\\
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
-
Re: RegEx
Hi Friedrich,
are there any news about this?
Markus
-
Re: RegEx
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
-
Re: RegEx
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
-
Re: RegEx
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
-
Re: RegEx
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
-
Re: RegEx
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
-
Re: RegEx