Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Regex remove any digit of files names #36

Open
alienlebarge opened this issue Feb 18, 2016 · 1 comment
Open

Regex remove any digit of files names #36

alienlebarge opened this issue Feb 18, 2016 · 1 comment
Milestone

Comments

@alienlebarge
Copy link

The regex that remove the digit prefixes from the file name to create the Handlebar template also remove any digit.

/(\d+[\-\.]?)+/ig
https://regex101.com/r/hK0rZ2/3

It means that when you have files like that:

atoms/01-headings/01-heading-level-01.html
atoms/01-headings/01-heading-level-1.html
atoms/01-headings/02-heading-level-02.html
atoms/01-headings/02-heading-level-2.html

atoms/01-headings/01-heading-level-01/01-headings-level-01-red.html

you will get an error.

see #31

Workaround

for now I use this workaround:

atoms/01-headings/01-heading-level-one.html
atoms/01-headings/02-heading-level-two.html
...
@alienlebarge
Copy link
Author

/(^|\/)\d+[.-]?/img, '$1' seems to be a good solution

@LukeAskew LukeAskew added this to the 2.0 milestone Jun 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants