Perl regex to find any numbers that is multiple of 5.
I tried using =~ /[5]+/
but it is finding only numbers which contains 5, but not multiple of 5.
And also to find string whose length is multiple of 5.
Numbers that are multiple of 5 either end with 5 or 0.
Try using /^-?\d*[05]$/
, which means:
^
start of string (saflknfvs34535 won't work).-?
A minus sign or not (if you only want positive numbers, don't put that).\d*
numbers, any numbers.[05]
0 or 5.$
end of string (324655sefgsfgsfg wont' work).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With