简体   繁体   中英

Regex - Remove first 5 and last 4 digits

We are scanning in a card that needs to have the first 5 numbers removed and last 4 removed.

Example card number (all numbers can can/will change).

2011698951650708

So far we have ^.{5}(.{7}) and replacement $1

we are getting 98951650708 but want 9895165

Link to where I am testing regexstorm

Using .NET

您正在寻找的正则表达式是:

\d{5}(\d+)\d{4}

Try this -

(?<=\d{5})\d(?=\d{4})

https://regex101.com/r/XbiMFI/2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM