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 -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -