Reply

ConfigBlockCheck and multi-line regular expressions

Techie
Posts: 17
4109     0

I'm writing a raw XML rule and I need to find blocks of text in device config files that are delimited by two consecutive lines at the beginning of the block and two consecutive lines at the end of the block. Is is possible to use multi-line regular expression patterns in the block-start and block-end attributes of the ConfigBlockCheck tag of a raw XML rule? Does anyone have a working example?

 

Here is what I'm looking for at the beginning of the block.

 

config vdom
edit vdom_name

 

Here is what I'm looking for at the end of the block

 

end

end

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 353
4110     0
Yes, I believe you can use something like /yourregex\nnextline/m, but I haven’t tried it.

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 470
4110     0

Did you get it working or still need some help?

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

https://sifbaksh.com

Re: ConfigBlockCheck and multi-line regular expressions

Techie
Posts: 17
4110     0

I tried that. It did not work. Reading the XML schema documentation made me think it would work but it didn't. I don't know what else to try.

Re: ConfigBlockCheck and multi-line regular expressions

Adviser
Posts: 353
4110     0
Can you post a config snippet and the XML you are using (or even better a simplified version)? I just looked at the code and in theory this should work.
Showing results for 
Search instead for 
Did you mean: 

Recommended for You