I have a yaml which looks like this..! Sonar by default providing sonar-yaml-plugin with some templates which accepts regex as input to verify particular key is present or not in .yml file.
I want regex to match entire key logging:file
server:
port: 8989
logging:
file: ./sample1.txt
path: ./log
I have tried using (logging)(?s:.*?)(file) but its not validating when I use it in sonar-plugin.
I'm not so sure what you may want to match, but maybe this regex might help you to do so or design your desired expression:
^(logging:|\s+file:)(.+)
.+
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.