Regular Expressions 101

Community Patterns

Community Library Entry

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 - 5 years ago