Hi, right now I'm practicing how to use "else if," but I sometimes get confused about how to use the parentheses. Could you provide me with any resources to help me better understand the "else if" condition? It just confuses me. Also, do you have any resources to easily understand regex, aside from Regex101?
Regarding conditional logic, search can perform those nested If statements but they can get a bit busy. Here is an example of a basic if/then/else followed by two levels of nesting of the if statement. Notice that after each if there is a parenthesis, but then all of the other ones that close the open parentheses are after the last else in the condition.
$if_statement = max(if(principal.hostname = /win-adfs/, 5, 0))
$if_nested_statement = max(if(principal.hostname = /win-adfs/, 5, if(principal.hostname = /server/, 3, if(principal.hostname = /win-atomic/, 1, 100))))
This is the wiki for re2 that is a generally good place to start. Regex 101 is still a great spot to test.
Regarding conditional logic, search can perform those nested If statements but they can get a bit busy. Here is an example of a basic if/then/else followed by two levels of nesting of the if statement. Notice that after each if there is a parenthesis, but then all of the other ones that close the open parentheses are after the last else in the condition.
$if_statement = max(if(principal.hostname = /win-adfs/, 5, 0))
$if_nested_statement = max(if(principal.hostname = /win-adfs/, 5, if(principal.hostname = /server/, 3, if(principal.hostname = /win-atomic/, 1, 100))))
This is the wiki for re2 that is a generally good place to start. Regex 101 is still a great spot to test.
Hmm, make sense now. Thank you for this information.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.