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

yeezy

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?

Hao Wu

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

/\d+(?![i\d])/

You may see the test cases here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I find a particular word followed by a space followed by a number?

How do I find a character followed by a character in a char array Java?

How do I extract sentences in regex that are separated by a word followed by a semicolon?

Find 'word' not followed by a certain character

Javascript regex to check for a word followed by a character

Regex python ignore word followed by given character

Regex to match numbers followed by a specific character

Regex to not match numbers followed by a certain character

Regex for a word followed by multiple numbers in a sequence

regex - find out strings that contains one word or its substring not followed by a certain character

Regex to find new lines not followed by a character

RegEx to find any uppercase word followed by a colon

Javascript Regex to find numbers followed by 'px' or '%'

Regex to find all numbers followed by dot

how do i find a character in a text and then copy the word that had that character python

javascript regex do not followed by specific character

In a regex, how do I ensure that if I find one particular character, I should also find another character as well in the string?

How to find if a word immediately followed by a non-letter character exists in a String

Regex How to remove any character that is not followed by a number

regex to ignore number followed by a word/non-numeric character

how to extract numbers in regex followed by multiple conditions

find all word start with specific character followed by digits in string

Regex to match if not followed by a character?

How do I escape a special Regex character?

How do I limit a character appearance in a regex?

REGEX find words in upper case and words followed by a single special character

How do I extract a series of numbers along with a single letter followed by another series of numbers?

How do I find if string has at least one character using regex?

Regex: how to find a string followed by a non alphanumeric