Yaml 解析器令人窒息

发布于 2024-07-27 00:24:35 字数 551 浏览 8 评论 0原文

我有一个 yaml 片段

...
passwordregexp: '.{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]'
passwordregexpfailmessage: |-
    Contain at least 8 characters
    Contain at least 1 Number
    Contain at least  1 Special Character
    Contain at least 1 Upper Case Letter
    Contain at least 1 Lower Case Letter
passwordresetperiod: 1000
pdflatex_path: /usr/local/texlive/bin/x86_64-linux/pdflatex
...

我的 yaml 解析器因 Passwordregexfailmessage 而阻塞: 很明显它不喜欢语法,但不熟悉 yaml。 如何引用或构造此元素以使其可解析。

如果密码不符合passwordregexp 标准,则会显示此信息。

I have a yaml snippet

...
passwordregexp: '.{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]'
passwordregexpfailmessage: |-
    Contain at least 8 characters
    Contain at least 1 Number
    Contain at least  1 Special Character
    Contain at least 1 Upper Case Letter
    Contain at least 1 Lower Case Letter
passwordresetperiod: 1000
pdflatex_path: /usr/local/texlive/bin/x86_64-linux/pdflatex
...

My yaml parser chokes on Passwordregexfailmessage:
Its clear it doesnt like the syntax but am not familiar with yaml. How do you quote or structure this element to make it parsable.

This is to be displayed if a password does not meet the passwordregexp criteria.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肥爪爪 2024-08-03 00:24:35

该文档有效 YAML 1.1

%YAML 1.1
---
!!map {
    ? !!str "passwordregexp"
    : !!str ".{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]",
    ? !!str "passwordregexpfailmessage"
    : !!str "Contain at least 8 characters\nContain at least 1 Number\nContain at\
        \ least  1 Special Character\nContain at least 1 Upper Case Letter\nContain\
        \ at least 1 Lower Case Letter",
    ? !!str "passwordresetperiod"
    : !!int "1000",
    ? !!str "pdflatex_path"
    : !!str "/usr/local/texlive/bin/x86_64-linux/pdflatex",
}
...

解析器是什么? 它支持 YAML 1.1 吗?

The document is valid YAML 1.1

%YAML 1.1
---
!!map {
    ? !!str "passwordregexp"
    : !!str ".{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]",
    ? !!str "passwordregexpfailmessage"
    : !!str "Contain at least 8 characters\nContain at least 1 Number\nContain at\
        \ least  1 Special Character\nContain at least 1 Upper Case Letter\nContain\
        \ at least 1 Lower Case Letter",
    ? !!str "passwordresetperiod"
    : !!int "1000",
    ? !!str "pdflatex_path"
    : !!str "/usr/local/texlive/bin/x86_64-linux/pdflatex",
}
...

What is the parser ? Does it support YAML 1.1 ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文