Regex match two words and not match other -


how can write regex match follow conditions:

( (iphone|ipod) or ( android , mobile , (not gt-p) ) )

would me?

edit:

with in comments i've follow code:

iphone|ipod|(android(?!.*?gt-p)(?:\s*mobile))? 

it same regex more on group android alone not match... correct?

this might you're after:

iphone|ipod|android(?!.*?gt-p)(?:\s*mobile)? 

https://regex101.com/r/xt8rd4/1

it allow android , android mobile not followed gt-p. if should allow android mobile, it's easy fix.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -