BarcodeScannerInput with Regex

I'm working on setting up a BarcodeScannerInput that matches a regex.

/\b\d{6}-\d{3}(?:.\d{2})?(?:P\d{2}(?:.\d{2})?)?\b/g

my expression seems to match in regex101, but not getting a match in the barcode component.

i tried to simplify to

/\b\d{6}-\d{3}\b/g
to capture "123456-001", but was also unsuccessful.

any advice?

make sure your window prop is large enough to capture the full length of the barcode.

Regex can get hairy quick, personally, I like this format better

[0-9]{6}-[0-9]{3}

I've stopped using regex with this component. I stick to prefix/suffix framing and use a custom parsing class that attempts to parse the barcode against my precompiled regexes and returns the barcode type that was scanned along with the data it was parsed into.