litle help with regex please

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
I have this format

something;something;something

first one= .*?(?=;-)
second one= (?<=;-).*?(?=;-)
third one should be= (?<=;-).*?

I can't get the last one out even thoug I'm using regex builder....

thanks in advance,
 

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
wait, all smileys I see,

should be the same with :

(?<=:-).*?


this doesn't work to get out the laste one in

something:something:something



EDIT: Just think away the smileys please....
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
Why don't you use tables for that or C# macro with split function
 
  • Спасибо
Реакции: neutralhatter

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
I have though of both but I had 2 reasons for this:

1. tables is more work since I need to change this in 4 templates and if I use tables I can better use xls and change my current approach(current approach is copying accounts in every template, 1: account creation, wait, 2: account setup, wait, 3 preperation for final steps, wait, 4 final steps...) with tables it's probably best that I create 1 xls with current datetime in the name, and then in every step add 1 column field with "OK" or "Failed" in it... instead of copying each account in to a new file....

2. I didn't use split function because it relies on C#, and with a big update my template may become deprecated like those of code creator of zenno 3...

But since you suggest it, I'll go for the split function...
 

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
Okey,

tried it, Split works but some things I noticed:

1. When I test my code and I make a change in the "Test macros" window, it just keeps giving the same errors even if I change the code. I need to close the "Test macros" change in the code and test again.

2. I can't set a variable in C#

project.Variables["myEmail"].Value = credentialarray[0];

= Exception has been thrown by the target of invocation


I can only return 1 value, this means I have to copy the C# to 3 macros.... and since ".Value" property allows Set and Get it should work. or it should only allow "Get"
 

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
The exception above only happens in the "Test macros" window. I just tried to run it and it works....
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
  • Спасибо
Реакции: neutralhatter

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
Thanks for the tip... But I got it working!
I actually do really prefer to work in code since searching for blocks in the toolbox is more timeconsuming in my experience...
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)