Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Regex to match when input is not a certain string (can't use grep -v) Post 302392207 by anbu23 on Wednesday 3rd of February 2010 03:45:41 PM
Old 02-03-2010
Code:
cd ${source_directory}
ls  | awk '/"'"${mutant}"'"/ && /short.*\.prmtop/'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep fixed string with regex

Hello, all! Maybe the title is badly formulated, you can help me with that...! I'm using the GNU grep, and I need to make sure that grep will extract only what I tell it to. I have the following regular expression: *? Well, I need to make sure I grep only a word which may start with a... (11 Replies)
Discussion started by: teresaejunior
11 Replies

2. Shell Programming and Scripting

grep regex, match exact string which includes "/" anywhere on line.

I have a file that contains the 2 following lines (from /proc/mounts) /dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0 /dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0 I need to match the string in the second column exactly so that only one result is returned, e.g. > grep... (2 Replies)
Discussion started by: jelloir
2 Replies

3. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

4. Shell Programming and Scripting

Match string from two file input

Hello all, I have file like this: file 1: aa bb cc dd ee file2: 111 111 111 111 111 111 (2 Replies)
Discussion started by: attila
2 Replies

5. Shell Programming and Scripting

perl regex string match issue..kindly help

i have a script in which i need to skip comments, and i am able to achieve it partially... IN text file: {**************************** {test : test...test } Script: while (<$fh>) { push ( @data, $_); } if ( $data =~ m/(^{\*+$)/ ){ } With the above match i am... (5 Replies)
Discussion started by: avskrm
5 Replies

6. Shell Programming and Scripting

Print lines that match regex on xth string

Hello, I need an awk command to print only the lines that match regex on xth field from file. For example if I use this command awk -F"|" ' $22 == "20130117090000.*" 'It wont work, I think, because single quotes wont allow the usage of the metacharacter star * . On the other hand I dont know... (2 Replies)
Discussion started by: black_fender
2 Replies

7. Shell Programming and Scripting

Regex to match only first occurence with grep

Hello to all, How would be the correct regex to match only the first occurence of the pattern 3.*6. I'm trying with 3.*6 trying to match only 34rrte56, but with my current regex is matching 4rrte567890123456789123powiluur56. And if I try with ? doesn't print anything echo... (6 Replies)
Discussion started by: Ophiuchus
6 Replies

8. Shell Programming and Scripting

Read input and match string

#!/bin/ksh echo DB LIST ps -ef | grep pmon | grep -v grep | awk -F_ '{print $3}' | sort db_up=`ps -ef | grep pmon | grep -v grep | awk -F_ '{print $3}' | sort` echo echo "Enter database name from the above list" echo read ORACLE_SID echo echo Database selected is: $ORACLE_SID echo ... (10 Replies)
Discussion started by: crazy_max
10 Replies

9. Shell Programming and Scripting

Grep with regex containing one string but not the other

Hi to you all, I'm just struggling with a regex problem and I'm pretty sure that I'm missing sth obvious... :confused: I need a regex to feed my grep in order to find lines that contain one string but not the other. Here's the data example: 2015-04-08 19:04:55,926|xxxxxxxxxx| ... (11 Replies)
Discussion started by: stresing
11 Replies

10. Shell Programming and Scripting

Grep string with regex numeric characters

Hi all, I have the following entries in a file: Cause Indicators=80 90 Cause Indicators=80 90 Cause Indicators=82 90 Cause Indicators=82 90 Cause Indicators=82 90 The first 2 digits might change so I am after a sort of grep which could find any first 2 digits + the second 2,... (3 Replies)
Discussion started by: nms
3 Replies
MB_REGEX_SET_OPTIONS(3) 						 1						   MB_REGEX_SET_OPTIONS(3)

mb_regex_set_options - Set/Get the default options for mbregex functions

SYNOPSIS
string mb_regex_set_options ([string $options = mb_regex_set_options()]) DESCRIPTION
Sets the default options described by $options for multibyte regex functions. PARAMETERS
o $options - The options to set. This is a string where each character is an option. To set a mode, the mode character must be the last one set, however there can only be set one mode but multiple options. Regex options +-------+-------------------------------+---+---+ |Option | | | | | | | | | | | Meaning | | | | | | | | +-------+-------------------------------+---+---+ | i | | | | | | | | | | | Ambiguity match on | | | | | | | | | x | | | | | | | | | | | Enables extended pattern form | | | | | | | | | m | | | | | | | | | | | | | | | | '.' matches with newlines | | | | | | | | | s | | | | | | | | | | | | | | | | '^' -> 'A', '$' -> '' | | | | | | | | | p | | | | | | | | | | | Same as both the m and s | | | | | options | | | | | | | | | l | | | | | | | | | | | Finds longest matches | | | | | | | | | n | | | | | | | | | | | Ignores empty matches | | | | | | | | | e | | | | | | | | | | | eval(3) resulting code | | | | | | | | +-------+-------------------------------+---+---+ Regex syntax modes +-----+----------------------------+---+---+ |Mode | | | | | | | | | | | Meaning | | | | | | | | +-----+----------------------------+---+---+ | j | | | | | | | | | | | Java (Sun java.util.regex) | | | | | | | | | u | | | | | | | | | | | GNU regex | | | | | | | | | g | | | | | | | | | | | grep | | | | | | | | | c | | | | | | | | | | | Emacs | | | | | | | | | r | | | | | | | | | | | Ruby | | | | | | | | | z | | | | | | | | | | | Perl | | | | | | | | | b | | | | | | | | | | | POSIX Basic regex | | | | | | | | | d | | | | | | | | | | | POSIX Extended regex | | | | | | | | +-----+----------------------------+---+---+ RETURN VALUES
The previous options. If $options is omitted, it returns the string that describes the current options. SEE ALSO
mb_split(3), mb_ereg(3), mb_eregi(3). PHP Documentation Group MB_REGEX_SET_OPTIONS(3)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy