Regular Expression with Variables ?

WilliFrosch

Client
Регистрация
10.12.2014
Сообщения
102
Благодарностей
5
Баллы
18
I'm currently working on a project where my bot places pre-orders.
The user enters the name of the product, and I want to use regular expressions to search the website for that product.
I planned to store the product name (which the user can enter freely) in a variable and use that variable to build the regular expression.
However, when I do that, it doesn't find any matches on the website.
Is that not possible, or am I doing something wrong?

screen 1 without variable i get results ( also a lot of results cause hes filtering all values from product name like different versions etc.
screen 2 with variable i get 0 results. variable has a default value
 

Вложения

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 903
Благодарностей
1 200
Баллы
113
I'm currently working on a project where my bot places pre-orders.
The user enters the name of the product, and I want to use regular expressions to search the website for that product.
I planned to store the product name (which the user can enter freely) in a variable and use that variable to build the regular expression.
However, when I do that, it doesn't find any matches on the website.
Is that not possible, or am I doing something wrong?

screen 1 without variable i get results ( also a lot of results cause hes filtering all values from product name like different versions etc.
screen 2 with variable i get 0 results. variable has a default value
Variables do not work in REGEX TESTER. But they will work in Regex action when you execute.
 

WilliFrosch

Client
Регистрация
10.12.2014
Сообщения
102
Благодарностей
5
Баллы
18
Then it would actually be easiest to just list the different product names in a dropdown menu, and depending on which product the user selects, the corresponding parsed text would be used in the project.

That way, I could avoid all the back and forth with variables and the separate parsing of the text, because the selected option from the dropdown would already have the correct parsed text assigned to it right ?
 

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