If the digits, letter and hyphen can appear mixed together in any order (like 1234k56-78, use a regex like this:

(?=.*[A-Za-z])(?=.*-)(?=(?:.*\d){8}).{10}

If the digits need to all be consecutive, then use a regex like this:

(?=.*[A-Za-z])(?=.*-)(?=.*\d{8}).{10}
Answer from coffee-converter on Stack Overflow
๐ŸŒ
Regex Tester
regextester.com โ€บ 111688
exactly 8 digits - Regex Tester/Debugger
Regex Tester is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details.
๐ŸŒ
Regex Tester
regextester.com โ€บ 95151
8 digits - Regex Tester/Debugger
Regex Tester is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details.
๐ŸŒ
RegExr
regexr.com โ€บ 3d63m
RegExr: Learn, Build, & Test RegEx
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp). Supports JavaScript & PHP/PCRE RegEx.
๐ŸŒ
Alteryx Community
community.alteryx.com โ€บ home โ€บ participate โ€บ discussions โ€บ alteryx one
Trying to pull an 8 digit number from a description column using the RegEx tool - Alteryx
September 26, 2023 - ... If there arent any other 8 character digit sets in the any of your strings you can use (\d{8}) or if they all start with 81 then ([81]+\d{6}). ... Thanks so much - so cool! ... If there arent any other 8 character digit sets in the any of ...
Find elsewhere
๐ŸŒ
UiPath Community
forum.uipath.com โ€บ help
Regex to select eight digit number - Help - UiPath Community Forum
October 4, 2018 - Hi Everyone, I want to select an eight digit number without any space or hyphen even if it presents. In the below snippet i want to select only 01299100 and regex should not take the number 00210000 by excluding - or spโ€ฆ
๐ŸŒ
Regex101
regex101.com โ€บ r โ€บ r94C4m โ€บ 2
regex101: 8 3-digit numbers capture groups - w spaces - long!
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
๐ŸŒ
NTU Singapore
www3.ntu.edu.sg โ€บ home โ€บ ehchua โ€บ programming โ€บ howto โ€บ Regexe.html
Regular Expression (Regex) Tutorial
Regex recognizes common escape sequences such as \n for newline, \t for tab, \r for carriage-return, \nnn for a up to 3-digit octal number, \xhh for a two-digit hex code, \uhhhh for a 4-digit Unicode, \uhhhhhhhh for a 8-digit Unicode.
๐ŸŒ
Regex Pal
regexpal.com โ€บ 95151
8 digits - Regex Pal
RegexPal is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details.
๐ŸŒ
Regex Pal
regexpal.com โ€บ 93582
8-digit w/ leading zero - Regex Pal
RegexPal is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details. Save & share expressions with others. Explore the Library for help & examples. Undo & Redo with {{getCtrlKey()}}-Z / Y. Search for & rate Community patterns. ... extended (x) extra (X) single line (s) unicode (u) Ungreedy (U) Anchored (A) dup subpattern names(J) ... Match string not containing string Check if a string only contains numbers Match elements of a url Match an email address Validate an ip address Match or Validate pho
๐ŸŒ
Regex Tester
regextester.com โ€บ 93582
8-digit w/ leading zero - Regex Tester/Debugger
Regex Tester is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details. Save & share expressions with others. Explore the Library for help & examples. Undo & Redo with {{getCtrlKey()}}-Z / Y. Search for & rate Community patterns. ... extended (x) extra (X) single line (s) unicode (u) Ungreedy (U) Anchored (A) dup subpattern names(J) ... Match string not containing string Check if a string only contains numbers Match elements of a url Match an email address Validate an ip address Match or Validate
๐ŸŒ
Eloquent JavaScript
eloquentjavascript.net โ€บ 09_regexp.html
Regular Expressions :: Eloquent JavaScript
Say we want to match any number. In a regular expression, putting a set of characters between square brackets makes that part of the expression match any of the characters between the brackets. Both of the following expressions match all strings that contain a digit: