Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-05-09 21:40
Flavor·Python

r"
^.*\sv((\d+\.)?(\d+\.)?(\d+)).*$
"
Open regex in editor

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