Guest User

fancyBarcode

a guest
Jul 8th, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(input) {
  2.  
  3.     input.shift()
  4.     let barcodes = input
  5.     let pattern = /(@#+)([A-Z][a-zA-Z0-9]{4,}[A-Z])(@#+)/g
  6.     let diggits = /\d+/g
  7.  
  8.    
  9.    
  10.     let matches = []
  11.  
  12.     for (const barc of barcodes) {
  13.        
  14.  
  15.             let checkBarcode = pattern.exec(barc)
  16.             if(checkBarcode != null) {
  17.              ?????
  18.         } else {
  19.             console.log(`Invalid barcode`);
  20.         }
  21.            
  22.            
  23.        
  24.  
  25.     }
  26.  
  27.  
  28. }
Add Comment
Please, Sign In to add comment