@ygemici
Grep is just used here to demonstrate the extended regular expression in action.
The OP has requested we not use the negation options (! or -v), as these add complexity to the system requiring them.
I can't see any problem with the R.E I supplied; can you supply a string that gives a false positive/negative?
Remember this R.E. is supposed to match any line that doesn't contain "this" or "that".
Ok I already understand but may be many scenarios in our case..
Quote:
Originally Posted by stevensw
With find -regex (with -regextype posix extended) not sed or grep. It is for an auditing script that checks for non-standard filenames.
I guess he wants to determine some rules for user specific conditons to write regex.
But different (sed or awk or grep or perl or ruby or anys (differs in different architectures) ,,can may use different convention as in defined reg libraries..
And according to me , not to use (! or -v) is unobtainable for fixed words
because of this is just significant meaningful for common definitions.So these are already defined for this purpose.
== e.g ==
For audit log , I try to write a some regex
[ REGEX= (must be Perl-compatible RegEx) ]
Although we dont know will be use which regex library(posix or not or gnu).Just guess..
Now lets look your grep.
for example
And some lines are missing and some lines has in..
below is desired output ? I dont think so..
now try to grep with wordregexp only supplies containing matches with non_words (not punct)
Try justdoit code (according to me the correct result)
and maybe we get same with this (equals to justdoit)
I modified your --extended-regexp
regards
ygemici
I am formatting my code and for that I am trying to write a script which can quicken some repetitive work.
I need to match "==" exactly in a string and replace it by inserting a (single) blank space before and after it.
Sample Strings:
1.this.something =='something'.that... (9 Replies)
Hi All,
I am breaking my head in trying to get a command that will exactly match my given string. I have searched net and found few of the options -
grep -F $string file
grep -x $string file
grep "^${string}$" file
awk '/"${string}"/ {print $0}' file
strangely nothing seems to... (3 Replies)
Hi all,
Here is the data file:
- want to match only lan3 in the output .
- not lan3:1
file :
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME="lan3"
IP_ADDRESS="10.53.52.241"
SUBNET_MASK="255.255.255.192"
BROADCAST_ADDRESS=""
INTERFACE_STATE=""... (2 Replies)
I want to output the records matched with a string like "abcdefg", but with one letter difference at any position.
Can I do this with awk or grep? Thank you! (1 Reply)
Hi, I want to check out a word in the text file and generate a clear report for me to see...
The text file content:
Content:
............
20120608:
20120608:
............
20120608:
..........
2012031201: , hime]
End of the file
My expected output is:
Full TXT:
manatsu
TXT:... (3 Replies)
Dear all,
there is a nice solution for a text merge where the second file has only variables with a numeric range ( sorry, cannot post URL + thread is closed ). The real world is however more complicated than in the earlier example.
file1
A 1
A 2
A 3
B 1
B 2
B 3
B 4
C 1
C 2
C 3
C... (4 Replies)
Hi,
I have a file like following,
aaabb
aaavv
bbdddaaab
fgdgjhaa
bfd
12352aa
dgs1xaf
sdgsdyg4
How can i get the output below(mask off all the line that have "a") by using vim
#aaabb
#aaavv
#bbdddaaab
#fgdgjhaa
bfd
#12352aa (4 Replies)
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Hi,
I'm trying to get one field out of many as follows:
A string of multiple fields separated with "/" characters:
"/ab=12/cd=34/12=ab/34=cd/ef=pick-this.one/gh=blah/ij=something/"
I want to pick up the field "ef=pick-this.one" which has no regular pattern except it starts with "ef=xxxx"... (3 Replies)
Hi, I would like to set up a Posix string to match the subject line in spam e-mails which contain
""
How do I get the square brackets recognised as literals and then include them in a string so that I can reject spam with things like in the subject line. (11 Replies)