Regular Expression to match statement that contain word 'abc'

user3029956

I handle a monitoring tools for application. I have data like this:

WebSphere_MB[MB7QMGR-MB7BROKER-default_abc]@esb01:2222222
WebSphere_MB[MB7QMGR-MB7BROKER-default]@esb01
WebSphere_MB[MB7QMGR-MB7BROKER-xxxabc]@esb01:11111111
WebSphere_MB[MB7QMGR-MB7BROKER-esbon2a]@esb01
WebSphere_MB[MB7QMGR-MB7BROKER-esbon2b]@esb01
WebSphere_MB[MB7QMGR-MB7BROKER-devxxx]@esb01
WebSphere_MB[MB7QMGR-MB7BROKER-defg]@esb01

I need to filter only statement which contains "xxxabc", "default_abc" and "devxxx" that appear in my data.

What regex should I used to do that?

Nilesh Thakkar

It seems that you want to select all statements which either has "abc" or "xxx".

try using /(abc)|(xxx)/g or try your data with http://www.regexr.com/ - its easy to build your regEx

Below will select whole statements matching "abc" or "xxx"

.*?(?:abc|xxx).*  

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Regular Expression to match statement that contain word 'abc'

From Dev

Regular expression match *abc* but not *bc*abc*bc*

From Dev

Regular expression match *abc* but not *bc*abc*bc*

From Java

Regular expression to match a line that doesn't contain a word

From Dev

Regular expression to match text that "doesn't" contain a word?

From Dev

regular expression to match word-word or word

From Dev

Regular expression to match part of word

From Dev

Regular expression to match not containing a word

From Dev

Regular expression that finds [abc] but not [;;abc]

From Dev

Regular expression, match a partial word, C#

From Java

Regular expression to match a word but not inside backticks

From Java

Regular expression to match a word or its prefix

From Dev

grep - regular expression - match till a specific word

From Dev

Regular expression: Match everything after a particular word

From Dev

Function to match a word in a string on a regular expression in MySQL

From Dev

match exact arabic word using regular expression

From Dev

Python Regular Expression to match multiple occurrences of word

From Dev

Regular Expression find match in text not after word

From Dev

Function to match a word in a string on a regular expression in MySQL

From Dev

Greedy match in MS Word regular expression?

From Dev

Regular expression to match quasi import statement

From Dev

grep + regular expression to match word that located before the last word

From Dev

MySQL substring match using regular expression; substring contain 'man' not 'woman'

From Dev

Regular Expression to match string which doesn't contain substring

From Dev

Regular Expression to match a pattern that contain some string except some string

From Dev

Regular Expression to match a pattern that contain some string except some string

From Dev

Python Regular Expression - Match pattern that does not contain a string

From Dev

Regular expression for A123ABC

From Dev

Regular expression for A123ABC

Related Related

  1. 1

    Regular Expression to match statement that contain word 'abc'

  2. 2

    Regular expression match *abc* but not *bc*abc*bc*

  3. 3

    Regular expression match *abc* but not *bc*abc*bc*

  4. 4

    Regular expression to match a line that doesn't contain a word

  5. 5

    Regular expression to match text that "doesn't" contain a word?

  6. 6

    regular expression to match word-word or word

  7. 7

    Regular expression to match part of word

  8. 8

    Regular expression to match not containing a word

  9. 9

    Regular expression that finds [abc] but not [;;abc]

  10. 10

    Regular expression, match a partial word, C#

  11. 11

    Regular expression to match a word but not inside backticks

  12. 12

    Regular expression to match a word or its prefix

  13. 13

    grep - regular expression - match till a specific word

  14. 14

    Regular expression: Match everything after a particular word

  15. 15

    Function to match a word in a string on a regular expression in MySQL

  16. 16

    match exact arabic word using regular expression

  17. 17

    Python Regular Expression to match multiple occurrences of word

  18. 18

    Regular Expression find match in text not after word

  19. 19

    Function to match a word in a string on a regular expression in MySQL

  20. 20

    Greedy match in MS Word regular expression?

  21. 21

    Regular expression to match quasi import statement

  22. 22

    grep + regular expression to match word that located before the last word

  23. 23

    MySQL substring match using regular expression; substring contain 'man' not 'woman'

  24. 24

    Regular Expression to match string which doesn't contain substring

  25. 25

    Regular Expression to match a pattern that contain some string except some string

  26. 26

    Regular Expression to match a pattern that contain some string except some string

  27. 27

    Python Regular Expression - Match pattern that does not contain a string

  28. 28

    Regular expression for A123ABC

  29. 29

    Regular expression for A123ABC

HotTag

Archive