I am trying to include an udev rule to create a customized /dev/ entry depending on usb device attribute. I have two different bar code scanner which have the word Bar code Scanner and Barcode Scanner into manufacturer attrs.
So I am wondering if can I make it work by add regex into ATTRS{manufacturer}, as following:
ATTRS{manufacturer}=="(([bB]ar\ ?[Cc]ode\ ?)([Ss]can\ ?(ner)?))"
or should I:
ATTRS{manufacturer}=="\([Bb]ar\(\s\?\)[Cc]ode\s\?[Ss]can\)"
The regex presented above will accept the following variations:
Bar code Scanner
barcode scanner
barcodescanner
Barcode Scanner
bar code scanner
bar code scan
Bar Code Scan
BarCode Scaner
barCode scanner