// Javascript Regex Test example
/*
  [0-9]+ => Matches any digit (+) => one or more 
  \d{4} => Matches 4 digit
  n^ =>Matches any string with n at the beginning of it
  n$ => Matches any string with n at the end of it
  \d{1,} Matches at least 1 or more of Digit
*/

var pattern = /^\/auftrag\/edit\/AB-(\d{4})-([0-9]+)$/;
var pattern2 = /^\/auftrag\/edit\/AB-(\d{4})-(\d{1,})$/;
//014657
var res = pattern2.test("/auftrag/edit/AB-2021-155464");

console.log(res)