Getting values of a variable which have letter, numbers and symbols in linux

how to get all the different values of x where all the values are in this format x=326F4333-54F1-4B2A-550C-FBFD3145C59F. So there is no specific sequence for the numbers or the letters. But the pattern is fix as per the following: 8(letters and numbers)-4(letters and numbers)-4(letters and numbers)-4(letters and numbers)-12(letters and numbers).

You could use RegEx with sed:

Assuming you’ll use case-sensitivity:

  1. Lowercase only:
  • ([a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12})
  1. Uppercase only:
  • ([A-Z0-9]{8}-(?:[A-Z0-9]{4}-){3}[A-Z0-9]{12})
  1. Both:
  • ([a-za-Z0-9]{8}-(?:[a-zA-Z0-9]{4}-){3}[a-zA-Z0-9]{12})
1 Like