0
KELECTRIC.BNK.20160526

compare above expression and take 8 digits after 2nd full stop and total of 22 characters,

below expression is working fine till 2nd full stop but not taking number after full stop

^(KELECTRIC)\.(BNK)+\.$
nu11p01n73R
  • 26,397
  • 3
  • 39
  • 52

3 Answers3

2

You can accept number of 8 digits after 2nd full stop like this

^(KELECTRIC)\.(BNK)\.(\d{8})$
Kuba Wyrostek
  • 6,163
  • 1
  • 22
  • 40
Muhammad Hassan
  • 14,086
  • 7
  • 32
  • 54
1

Try ^(KELECTRIC)\.(BNK)\.[0-9]{8}$ or ^([A-Z]{1,})\.([A-Z]{1,})\.[0-9]{8}$

0
^(KELECTRIC)\.(BNK)\.([0-9]{8})$

this one answered by Kuba Wyrostek, and some other guys

thanks

Kuba Wyrostek
  • 6,163
  • 1
  • 22
  • 40
  • It will accept every character at position where only `.` can come. You should use `\.` instead. `KELECTRIC-BNK-20160526` will also be a valid string for this. – Muhammad Hassan Jun 10 '16 at 07:57
  • 1
    This is equivalent to answer by @MHassan, so it is better to accept his answer instead of writing your own. – Kuba Wyrostek Jun 10 '16 at 08:23