Alex Rivera | Logout

Can I use regular expressions to search for multiples of a number?

Asked 2010-12-23T11:24:19.490
11

I'm trying to search a big project for all examples of where I've declared an array with [48] as the size or any multiples of 48.

Can I use a regular expression function to find matches of 48 * n?

Edit
Report

1 Answer

0

No, regular expressions can't calculate multiples (except in the unary number system: decimal 4 = unary 1111; decimal 8 = unary 11111111, so the regex ^(1111)+$ matches multiples of 4).

answered 2010-12-23T12:20:41.360

Your Answer