Skip to content

How do i find the numbers that is not followed by a word character with regex?

I’m trying to do this thing that searches the number that is not followed by an “i”, for example:

21i and 16, it should only match 16

I tried /d+(?!i)/ but it also matches the 2 in 21i, how do i fix it?


So basically you need to find a cascade of numbers that not followed by an i nor another number:


You may see the test cases here