Hi
I have a file with data arranged into columns. The first column is the chromosome name.
When I use grep to subset only rows with chr1, I get chr1 but also chr10, chr11,..
How do I get only rows with chr1?
grep chr1 filein > fileout
head fileout
chr1 59757841
chr11 108258691 ... (2 Replies)
Hi all,
any idea how to match the following:
char*<no or any string or space> buf and
char *<no or any string or space> buf
i need to capture the buf characters too.
currently i need two checks to cover this:
#search char* <any string> buf or char *<any string> buf
@noarray =... (2 Replies)
Hello All
I have file which contain sample data like below -
test.txt
----------------------------------------------
jambesh aaa india
trxxx
sdasd
mentor
asss
light
train
bbblah
---------------------------------------------
I want to write a regX which would print only those... (4 Replies)
Hi all,
I am looking for a regex syntax to match repeated appearance. Likes,
']+]+' matches for string '65A SOME MORE AND 78B'
Now, this gets messy if I need to extract all such repeated appearance. I don't want to write ] four or five times for matching repeated appearance.
Thanks in... (2 Replies)
I am trying to match a similar line using grep with regular expression
the line is
/remote/mac/pbbbb/abc/def/hij/hop/include/abc/tif/element/test/testfiles/Office.cpp:57: const OfficeType& getType().get() const;
I just need to extract the bold characters using grep with regular expression.... (5 Replies)
hello,
I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface.
For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".")
I tried the following but... (3 Replies)
hi everyone
suppose we have two scenario
echo ABCD | grep \{4\}
DATE
echo SYSDATE | grep \{4\}
SYSDATE
i want to match the string of four length only please help (5 Replies)
echo 20110101 | awk '{ print match($0,/^((17||18||19||20)|)-*(|0|1)-*(|0||3)$/))
I am getting a match for the above, where as it shouldn't, as there is no hyphen in the echoed date.
Another question is what is the difference between || and | in the above statement (4 Replies)
Hello,
one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match
an example line is below
/logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
Discussion started by: Ramneekgupta91
9 Replies
LEARN ABOUT NETBSD
re_comp
RE_COMP(3) BSD Library Functions Manual RE_COMP(3)NAME
re_comp, re_exec -- regular expression handler
LIBRARY
Compatibility Library (libcompat, -lcompat)
SYNOPSIS
#include <re_comp.h>
char *
re_comp(const char *s);
int
re_exec(const char *s);
DESCRIPTION
This interface is made obsolete by regex(3). It is available from the compatibility library, libcompat.
The re_comp() function compiles a string into an internal form suitable for pattern matching. The re_exec() function checks the argument
string against the last string passed to re_comp().
The re_comp() function returns 0 if the string s was compiled successfully; otherwise a string containing an error message is returned. If
re_comp() is passed 0 or a null string, it returns without changing the currently compiled regular expression.
The re_exec() function returns 1 if the string s matches the last compiled regular expression, 0 if the string s failed to match the last
compiled regular expression, and -1 if the compiled regular expression was invalid (indicating an internal error).
The strings passed to both re_comp() and re_exec() may have trailing or embedded newline characters; they are terminated by NULs. The regu-
lar expressions recognized are described in the manual entry for ed(1), given the above difference.
DIAGNOSTICS
The re_exec() function returns -1 for an internal error.
The re_comp() function returns one of the following strings if an error occurs:
No previous regular expression,
Regular expression too long,
unmatched (,
missing ],
too many () pairs,
unmatched ).
SEE ALSO ed(1), egrep(1), ex(1), fgrep(1), grep(1), regex(3)HISTORY
The re_comp() and re_exec() functions appeared in 4.0BSD.
BSD June 4, 1993 BSD