Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?'id'[0-9a-fA-F]{2})(?:-(?'id_to'\w+))? ([ \/\w-]+)(?: [\/\w]+ \d+\.\d+)?$
/
gm

Description

A regex to transform tables from https://usb.org/sites/default/files/hut1_2.pdf to rust enum items

After pasting be sure to remove the whitespaces

Submitted by dzervas - 10 months ago