regex - 2 words
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:10 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:54 PM - edited 03-04-2024 07:00 PM
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
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:55 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 08:38 PM
Hi @levino .
Please use below regex:
^(?!.*(sudo|root)).*$
You can dynamically generate regex:
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda