cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Hello i am trying to make rule with regex so its working one problem is that when i use letter and digit without space it does not recognize in test classification. so if i write for example "text 1234" or "1234 text" its working but if i write  "text1234" or "1234text" it does not work, which symbol i have to use to fix this problem? thanks

1 Solution

Accepted Solutions
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 11 of 13

Re: Regex

Jump to solution

Hi @Georgiancard ,

Here you go,

[text]{4}\b  - Will identify only text 

\b[text]{4}\d{4}\b - Will identify text with 4 numbers - text8528

\b\d{4}[text]{4}\b - Will identify 4 numbers with text - 5565text

 

 

If you find this as a solution, kindly accept this as a solution! 

Thank you.

Regards,
Jithendran S
McAfee Employee

View solution in original post

12 Replies
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 13

Re: Regex

Jump to solution

Hi @Georgiancard ,

Thank you for writing in here.

Can you share the existing regex created for "text 1234".

 

 

Regards,
Jithendran S
McAfee Employee
Highlighted

Re: Regex

Jump to solution
hi, thanks for reply, so i use dictionary and advanced pattern.
firs i use in dictionary word "text" and in regex i use \b\d{4}\b, but i need something before \b\d{4}\b to recognize text and numbers together text1234
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 4 of 13

Re: Regex

Jump to solution

Hi @Georgiancard ,

You can use regex for the below requirement:

Requirement: I need something before \b\d{4}\b to recognize text and numbers together text1234

 

Regex Pattern: \b[A-Za-z]{4}\d{4}\b

This matches any 4 characters and any 4 numbers together without space between them.

 

regex.PNG

 

Thank you.

Regards,
Jithendran S
McAfee Employee
Highlighted

Re: Regex

Jump to solution
thanks for reply can i ignore numbers like 1111,2222... 1234,2345,5678... and discover only different like 7854,0143 to avoid false positive information
Highlighted

Re: Regex

Jump to solution
and one more question if i want only discover "text" how to make regex with this one word? for ex: text4563 or 3214text
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 7 of 13

Re: Regex

Jump to solution

Hi @Georgiancard ,

For identifying text4563 or any textxxxx - \b[A-Za-z]{4}\d{4}\b

For identifying  3214text or any xxxxtext - \b\d{4}[A-Za-z]{4}\b

For only identifying text in text4563 - [A-Za-z]{4}\b

For only identifying text in 3214text - \b[A-Za-z]{4}

 

Thank you.

Regards,
Jithendran S
McAfee Employee
Highlighted

Re: Regex

Jump to solution
thanks for reply, maybe i need ignore expressions like 1111text or text0000 or text1234 or 1234text and so on... l need ignore examples which are same values
Highlighted

Re: Regex

Jump to solution
you understood me wrong. i want identify text only this word not any word with 4 characters. how can i do this
Highlighted

Re: Regex

Jump to solution
hello, maybe you understood me wrong. i do not want identify any word i exactly want identify this word "text"
You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community