Regular Expressions 101

Community Patterns

Hugo Version Number

0

Regular Expression
Python

r"
^.*\sv((\d+\.)?(\d+\.)?(\d+)).*$
"

Description

Get the version number (like 0.69.2) from the "hugo version" output. Hugo is a static site generator (see https://gohugo.io).

Submitted by anonymous - 4 years ago