Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

regex - 2 words

levino
Giga Guru

Hi there

 

i need to add 2 words to  a regex

 

the below one works 

 

^(?!.*sudo).*$

 

i also need to add the word 'root'

Thanks

Levino

3 REPLIES 3

vermaamit16
Kilo Patron

Hi @levino 

 

Can you please describe what you are trying to achieve with this regex ? I assume that you are trying to ignore the matches which contains sudo and root keywords. If yes, you can try below regex :

 

 

^(?!.*(sudo|root)).*$

 

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

Maddysunil
Kilo Sage

@levino 

Please try like below

 

^(?!.*(sudo|root)).*$

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

 

Sumanth16
Mega Patron

Hi @levino .

 

Please use below regex:

 

^(?!.*(sudo|root)).*$

 

You can dynamically generate regex:

https://regex-generator.olafneumann.org/?sampleText=2020-03-12T13%3A34%3A56.123Z%20INFO%20%20%5Borg....

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda