Regular Expressions 101

Community Patterns

Normalizing data from a string

0

Regular Expression
Python

r"
\w\s(?P<type>\S+)\s(?P<name>\S+)\s(?P<model>\S+)\s(?P<code>\S+)\s(?P<serial_number>\S+)\s(?P<in_charge>\S+\s\S+\s\S+)
"
g

Description

Gets several strings and makes a list of data attributes in a formatted way

Submitted by SevebFeet - a year ago