Skip to content

Why use [\w\W] instead of . in regex-parser? #40

@mikaello

Description

@mikaello

When browsing the source code I noticed in the regex used for extracting the front matter that you use [\w\W]:

let re = /^(-{3}(?:\n|\r)([\w\W]+?)(?:\n|\r)-{3})?([\w\W]*)*/

Why do you do that, wouldn't . be equal? I.e.:

let re = /^(-{3}(?:\n|\r)(.+?)(?:\n|\r)-{3})?(.*)*/ 

This is a honest question, I just want to understand :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions