Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1829

Regex Help

by Meta - 01 November, 2021 - 01:26 AM
This post is by a banned member (Meta) - Unhide
Meta  
Supreme
1.364
Posts
336
Threads
5 Years of service
#1
Hey members,

Just need small help,

How do I make it so a regex matches 3 words: Hello Bye Welcome

In any order

Online I found solutions but not the ones I need as it also matched if there was a word between them. I want one which only matches them in any order without any other word between then except a space
I do NOT have a Discord or Telegram. @ProMasterCFGs is not my Telegram! PMs only.
I do not buy or sell anything.

 
This post is by a banned member (novuh) - Unhide
novuh  
Registered
13
Posts
5
Threads
3 Years of service
#2
So for instance, "Hello Bye Welcome" & "Welcome Hello Bye" would be a match? I'm just trying to make sure I'm understanding this right
website | novuh#2719 | seller/programmer
This post is by a banned member (Meta) - Unhide
Meta  
Supreme
1.364
Posts
336
Threads
5 Years of service
#3
(01 November, 2021 - 04:54 PM)novuh Wrote: Show More
So for instance, "Hello Bye Welcome" & "Welcome Hello Bye" would be a match? I'm just trying to make sure I'm understanding this right

yes but "Welcome ASD Hello Bye" should not be a match as there is a "ASD" in the middle
I do NOT have a Discord or Telegram. @ProMasterCFGs is not my Telegram! PMs only.
I do not buy or sell anything.

 
This post is by a banned member (SATAN) - Unhide
SATAN  
Godlike
3.138
Posts
486
Threads
4 Years of service
#4
ask @YASHViR__GAMiNG
This post is by a banned member (Meta) - Unhide
Meta  
Supreme
1.364
Posts
336
Threads
5 Years of service
#5
(02 November, 2021 - 06:50 PM)fallingaether Wrote: Show More
(01 November, 2021 - 01:26 AM)ProConfigMaker Wrote: Show More
Hey members,

Just need small help,

How do I make it so a regex matches 3 words: Hello Bye Welcome

In any order

Online I found solutions but not the ones I need as it also matched if there was a word between them. I want one which only matches them in any order without any other word between then except a space

This would work I believe...
Code:
\b(Hello|Bye|Welcome)\b

i need all the words to be in the text to match, not only singlur  sheepe
I do NOT have a Discord or Telegram. @ProMasterCFGs is not my Telegram! PMs only.
I do not buy or sell anything.

 
This post is by a banned member (Meta) - Unhide
Meta  
Supreme
1.364
Posts
336
Threads
5 Years of service
#6
(02 November, 2021 - 08:19 PM)fallingaether Wrote: Show More
(02 November, 2021 - 07:17 PM)ProConfigMaker Wrote: Show More
(02 November, 2021 - 06:50 PM)fallingaether Wrote: Show More
This would work I believe...
Code:
\b(Hello|Bye|Welcome)\b

i need all the words to be in the text to match, not only singlur  sheepe

This should work then:
 
Code:
(?=.*\bHello\b)(?=.*\bBye\b)(?=.*\bWelcome\b).+

The problem is it even matches "Hello Welcome OTHERWORD Bye"
I do NOT have a Discord or Telegram. @ProMasterCFGs is not my Telegram! PMs only.
I do not buy or sell anything.

 
This post is by a banned member (Jones765) - Unhide
Jones765  
Infinity
120
Posts
19
Threads
4 Years of service
#7
(This post was last modified: 02 November, 2021 - 09:52 PM by Jones765. Edited 1 time in total.)
Try this:

https://regex101.com/r/IvSXkN/1
This post is by a banned member (Meta) - Unhide
Meta  
Supreme
1.364
Posts
336
Threads
5 Years of service
#8
(02 November, 2021 - 09:51 PM)Jones765 Wrote: Show More

Yes but I have over 2k words for the real thing, can't put every single possibility kek
I do NOT have a Discord or Telegram. @ProMasterCFGs is not my Telegram! PMs only.
I do not buy or sell anything.

 

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 2 Guest(s)