02-28-2018 02:15 AM - edited 03-08-2019 02:03 PM
Hi all,
having problems trying to find a word inside a string. the string is:
{"reload": "True"}
So i'm trying to regex for the word 'True', and store it in a variable like so.
action 6.4 regexp "True" "$_cli_result" reg_res
However, what is happening is the result of $reg_res is the entire line.
The reason why i only want the word True to be stored in the $reg_res variable is because the next line there is an IF statement to check it.
Many thanks in advance.
Solved! Go to Solution.
02-28-2018 02:43 AM
Hi there,
Have you tried enclosing what you are trying to match in brackets?:
action 6.4 regexp "(True)" "$_cli_result" reg_res
cheers,
Seb.
02-28-2018 02:43 AM
Hi there,
Have you tried enclosing what you are trying to match in brackets?:
action 6.4 regexp "(True)" "$_cli_result" reg_res
cheers,
Seb.
02-28-2018 02:48 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide