views:

102

answers:

1

Hey guys,

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. thanks

A: 

The document is valid YAML 1.1 (http://instantyaml.appspot.com/):

%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 ?

Thanks andrey for the effort but i figured it out. It was choking on this character '-'. So instead of this:|- Contain at least 8 characters Contain at least 1 NumberI replaced it with:| Contain at least 8 characters Contain at least 1 Numberthats how you represent multiline character based on this wiki article http://en.wikipedia.org/wiki/String_literal. Search for Multi-line String representation
Afamee
But what is the parser ?