Skip to content

Commit

Permalink
adjusted regex of scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKoko committed Aug 12, 2024
1 parent 54c2320 commit 19e6a93
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/components/zxing-scanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const ZXingScanner = ({
* - ^(https?:\/\/[^\/]+\/ matches the protocol, domain, and the initial slash.
* - (?:qr\/)? optionally matches the /qr/ part.
* - ([a-zA-Z0-9]+))$ matches the QR ID which is the last segment of the URL.
* - $ ensures that there are no additional parts after the QR ID.
*/
// Regex to match both old and new QR code structures
const regex = /^(https?:\/\/[^/]+\/(?:qr\/)?([a-zA-Z0-9]+))$/;
Expand Down

0 comments on commit 19e6a93

Please sign in to comment.