Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?<=[\s\b()-])(\d+)(\.\d+)?(?=\s?[A-Za-z]?)((\s?[kmgtpun])?(i?b/?s?|s|hz)?)(?=[]\s\b()[]|$)
"
gmi

Description

Search regex for prefixed numerics (kB, Mb. ms. kHz etc.)

Submitted by delameter - 2 years ago