Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

Two simple doubts... CSS Scripting

Posts: 8
5275     0

I have two easy questions regarding CSS scripting:

 

1) Is there any way to match "something between (...) OR nothing? I mean:

 

Trigger-Template:

A

...

B

 

matches

 

A

1

2

B

 

or

 

A

sdfsdf

B

 

, but not...

 

A

B

 

Would "...|" work?

 

2) Is there any way to match i.e. three lines in a Trigger template, matched in ANY order? ( I mean, without dividing script in more triggers...) i.e. writing Trigger template that matches A & B & C in any order even with more lines:

 

A

B

C

 

C

B

A

 

A

lklkljk

B

C

 

should match...

 

Regards & thanks in advance. 

Highlighted

Re: Two simple doubts... CSS Scripting

Adviser
Posts: 431
5276     0

For 1 you can use the following regex

(?<=A)(\S*)(?=B)

 

For 2

You can create a Trigger Variable as a regex

 

$test /(A|B|C)/

 

Don't forget about NetMRI RegEx Tester

 

Sif

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Highlighted

Re: Two simple doubts... CSS Scripting

Posts: 8
5276     0

Second solution would match an OR expression. Isn'it? I mean A or B or C.

What I need is A and B and C lines in any order.

 

Thanks in advance.

Highlighted

Re: Two simple doubts... CSS Scripting

Adviser
Posts: 431
5276     0

Can you give me a config example Smiley Happy

 

Sif

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Highlighted

Re: Two simple doubts... CSS Scripting

[ Edited ]
Posts: 8
5276     0

Thanks.They sent me this solution:


/^(?=.*(FOG))(?=.*(HOUSE))/gms

matches FOG & HOUSE even in different lines & different order.

Thanks anyway.

Highlighted

Re: Two simple doubts... CSS Scripting

Adviser
Posts: 431
5276     0

That won't work in NetMRI Smiley Happy

"gms"  if you show me the extact config, I'm sure I have a script already for it.

 

Or are you trying to build a policy?

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Highlighted

Re: Two simple doubts... CSS Scripting

Posts: 8
5276     0

I'trying to build a CCS script just to match all this cases (just looking AAA & BBB on different ines)

 

AAA

sdasasd

BBB

 

AAA

BBB

 

BBB

AAA

 

BBB

asdsadas

adsdsa

AAA

 

I'm solving it now with two trigger outputs to check if "AAA"exists (trigger 1) and to check if "BBB" exists, but it dows not scale.

 

Thanks in advance. 

Highlighted

Re: Two simple doubts... CSS Scripting

Adviser
Posts: 53
5276     0

Try making the Trigger-Template look like this:

 

AAA

...

BBB

 

the ... should equate to "one or more lines" (note, not zero or more).

 

Thanks,

- Chris

 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You