[systemd-devel] Antw: [EXT] Udev Regex

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Wed May 6 12:40:45 UTC 2020


>>> "Boyce, Kevin P [US] (AS)" <Kevin.Boyce at ngc.com> schrieb am 06.05.2020 um
14:15
in Nachricht
<16534_1588767787_5EB2AC2A_16534_16_1_d2c2e1aff05740ea9d1ea3e1325511b2 at XCGVAG30.
orthgrum.com>:
> Good Morning List,
> 
> Does anyone know how complicated of a regular expression can be utilized in

> a udev rule?
> 
> For instance I have a system with a lot of drives (sda through z aren't 
> enough) and I want to write a rule that will match the physical block
devices 
> for one rule and then a separate rule for partitions.
> 
> Something like this, however the rules don't seem to fire except when I 
> remove the '+' from the rules:

The man page udev(7) I have lists '[', ']', '|', '*' and '?', but not '+'...

> ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a‑z]+", 
> SYMLINK+="some_device_%k"
> ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a‑z]+[0‑9]+", 
> SYMLINK+="some_device_%k"
> 
> I am running systemd version 219‑67.
> 
> Kind Regards,
> Kevin





More information about the systemd-devel mailing list