Page 1 of 1

help using find / search for multiple words

Posted: Tue Feb 12, 2008 6:50 pm
by trangen
I can't seem to find 2 separate string of characters.

How do I do this? can some one help please?

I need to search for
inbound
10.104.8.140

I tried
"inbound" "10.104.8.140"
\inbound\ \10.104.8.140\

Thanks in advance

Posted: Tue Feb 12, 2008 10:13 pm
by ben_josephs
Do you mean you want to find either inbound or 10.104.8.140?

This will do that:
Find what: inbound|10.104.8.140

[X] Regular expression
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Need to find them both on the same line

Posted: Tue Feb 12, 2008 10:37 pm
by trangen
Ben not or, AND

I need to find them both on the same line.

Going through the syslogs and I I can find single items but not both on the same line

Posted: Tue Feb 12, 2008 11:41 pm
by ben_josephs
Find what: inbound.*10.104.8.140|10.104.8.140.*inbound

[X] Regular expression
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Thanks Ben that worked

Posted: Wed Feb 13, 2008 12:03 am
by trangen
Thank you very much Ben, that worked!

all I needed was this part

inbound.*10.104.8.140

So the dot . is the (and separator), and the * asterics is the wild card to search for and match subsequent string.

Funny how I looked that up in the Help file and it doesn't show it.

I think I'll enter it as a feature request.

Thanks again,

Posted: Wed Feb 13, 2008 12:55 am
by Bob Hansen
Check the Help file again, look for How to Use Regular Expressions.

The dot is not a separator, it is actually the wild card, stands for any character.

And the * is for any number of the wildcard characters.

The "|" is the OR character.


So this is looking for any number of characters in between the two strings.
And the OR symbol is allowing the strings to come in either sequence.

Thanks Bob

Posted: Wed Feb 13, 2008 1:16 am
by trangen
Ok, Thanks Bob for answering that and clearing that up.

per your suggestion, I went back to check the help file again,
and no where does it give such example or explanation.

the version I have is 5.0.3

I think something so basic should be put in the help file.

I did put it in for a feature request for this today, if you check in the
"Enhancement Suggestions"

or maybe it was added in a newer Rev than mine.


Thanks again

Posted: Wed Feb 13, 2008 1:27 am
by Bob Hansen
I have also responded to the Enhancements postings.

From the How To Use Regular Expressions Help:
\|
|
Matches either the expression to its left or its right.
Example: hop\|hoop matches hop, or hoop.


I agree, it is not much, but see my other reply.

thanks

Posted: Wed Feb 13, 2008 1:29 am
by trangen
I didn't need an OR, just the AND, as in BOTH words

Posted: Wed Feb 13, 2008 1:53 am
by Bob Hansen
Hi trangen ....

I am really trying to help here, so please do not take my comments as criticism. The use of .* is more complex.

But disneyland.*california will not be limited to the words disneyland and california. It would also find disneylandworld followed by northerncalifornia or any other situations that include disneyland and california in a larger string

California might not be a good example. But, if you wanted the word "the" and "car", using the.*car would get words like them, these, heathen, cartoon, racecar, Carl, carpet, etc.

And the.*|.*car would do the same, only in an OR situation vs. a sequential one.

To get just the exact words, the RegEx needs to be more complex, defining words, and/or inserting space characters, the number of characters, etc. Your original search, inbound.*10.104.8.140 will also locate the two additional IPs of 110 and 210.104.8.140

Thanks

Posted: Wed Feb 13, 2008 4:09 pm
by trangen
I C, I C, said the blind man.

Just trying 2 b helpful, 4 others who might have been stuck w the similar situation.

Great Product!

Thanks Bob

Posted: Wed Feb 13, 2008 11:37 pm
by Bob Hansen
No problem.

I am still struggling with RegEx.
Here's a big thanks to ben_josephs for all of his help.

one last questions please

Posted: Thu Feb 14, 2008 12:59 am
by trangen
ok, since were on the subject.

How do I do this please?

how do I run 2 searches at the same time.
E.g.

I want to find:

inbound.*10.104.8.140
inbound.*10.104.9.17

I want to find ALL lines that have either inbound.*10.104.8.140 and
inbound.*10.104.9.17

I know they will BOTH NOT be on the same line.
they will be on separate lines.

Posted: Thu Feb 14, 2008 1:49 am
by Bob Hansen
Find what: (inbound.*( |0)10.104.8.140)|(inbound.*( |0)10.104.9.17)

This assumes that "inbound" is always before the IP address on the lines.

This will select strings that include "inbound" and the IPs, it is not limited to those specific words/IPs. See my earlier post.

There is a leading space char or a zero in front of the IPs to prevent 110 and 210 addresses from being selected. But, this does require a space or a zero for a match. Any other char will not match.
==============================
Open Find Window, use the following settings:
-----------------------------------------
[X] Regular expression
Mark All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------

Posted: Thu Feb 14, 2008 9:25 am
by ben_josephs
Or
inbound.*(\<10.104.8.140|\<10.104.9.17)

Solving these problems gives me a break from solving other problems. :-)