regex - PHP Find a 15 or 16-digit number in a long string -
i working on function sanitize credit card data replacing digits except last 4 x's. problem have lot of data stored in database json objects. each record may or may not have card number somewhere in it, , occur in different places in text record record (sometimes @ end, in middle, etc.) looking way extract 15-digit or 16-digit numbers string can pass number sanitize function.
looking way extract 15-digit or 16-digit numbers string
you can use:
\b[0-9]{15,16}\b
Comments
Post a Comment