Regex help | parse first 8 digits of string

Hello I need to parse the first 8 numbers of a string. I’ve tried finding a correct expression online but wasn’t able to get it working

  • the string has always 16-19 digits

Ty for help

^........

should work if string only has digits and u wanna extract first 8

^\d{8}
would also do it but would only ensure [0-9] are matched

You can also do groups if there are more things in the string

(\d{8})\d+

That one will match to the first 8 consecutive digits as group 1 or you can name the group

(?<test>\d{8})\d+

The first example output would be [0]
2nd would be [1]
3rd would be [test]

You can use the substring block to do this easily without regex, since the string has only numbers