Displaying 20 results from an estimated 2000 matches similar to: "Matching a period in grep..."
2008 Jun 23
3
One-to-one matching?
Hi folks,
Can anyone suggest an efficient way to do "matching without
replacement", or "one-to-one matching"? pmatch() doesn't quite provide
what I need...
For example,
lookupTable <- c("a","b","c","d","e","f")
matchSample <- c("a","a","b","d")
##Normal match()
2013 Feb 05
2
R Regular Expressions - Metacharacters
I thought that I can use metacharacters such as \w to match word characters
with one backslash. But for some reason, I need to include two backslashes.
> grepl(pattern='\w', x="what")
Error: '\w' is an unrecognized escape in character string starting "\w"
> grepl(pattern='\\w', x="what")
[1] TRUE
I can't find the reason for this
2008 Aug 22
1
grep, gsub and metacharacters
Hello,
I have an expression that I want to substitute for something else.
myvector<-c("ajkhfkiuwe","Variable(kg/min)")
if I use the following code to extract "variable(kg/min)" and substitute it for "va"
gsub(myvector[grep("var", myvector, ignore=T)], "va", myvector)
grep identifies the element of the vector that matches my
2012 Jul 08
3
list.files() find files beginning with a .
Hello,
when I use list.files with recursive = TRUE and all.files = TRUE, R returns
a list of strings/paths.
>From all those strings I want to keep only the ones starting with a .
I tried using grep to achieve that. However, the problem is that because of
the recursive list.files parameter,
for some files beginning with a . there is a path attached. I think it is
not as simple as it looks
2024 Aug 02
1
grep
?s 02:10 de 02/08/2024, Steven Yen escreveu:
> Good Morning. Below I like statement like
>
> j<-grep(".r\\b",colnames(mydata),value=TRUE); j
>
> with the \\b option which I read long time ago which Ive found useful.
>
> Are there more or these options, other than ? grep? Thanks.
>
> dstat is just my own descriptive routine.
>
> > x
> ?[1]
2013 Feb 28
3
Dealing with parentheses within variable names
Dear all
I'm having some problems with a data set that has parenthesis within the variable names. A example of this kind of variable names is the following:
fBodyGyroskewness()Z
The case is that R is having a lot of troubles to identify the variable (probably it does understand it like a function). I've tried (among other things) to remove the parenthesis from the name using the
2019 Jan 25
0
[klibc:update-dash] expand: Do not quote backslashes in unquoted parameter expansion
Commit-ID: afc40b4eb057b08d8cc2eebefdf6cac05849e8ae
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=afc40b4eb057b08d8cc2eebefdf6cac05849e8ae
Author: Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Wed, 28 Mar 2018 18:37:51 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 25 Jan 2019 02:57:21 +0000
[klibc] expand: Do not quote
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not quote backslashes in unquoted parameter expansion
Commit-ID: 6b0cf885180cfb08f7ec5139e67e581bbba5d6be
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=6b0cf885180cfb08f7ec5139e67e581bbba5d6be
Author: Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Wed, 28 Mar 2018 18:37:51 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:55 +0000
[klibc] dash: expand: Do not
2023 Dec 18
1
Announce: OpenSSH 9.6 released
OpenSSH 9.6 has just been released. It will be available from the
mirrors listed at https://www.openssh.com/ shortly.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.
Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested
2015 Feb 14
2
C5 BASH IF
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 14/02/15 16:53, Les Mikesell wrote:
<snip>
> To understand it completely you need to know the order of
> operations as the shell makes multiple passes over the line,
> parsing, processing metacharacters, and expanding variables. And
> I don't know where to find a concise description of that any more.
man bash, about 900
2009 Nov 13
6
replace a whole word with sub()
Dear all,
I cannot figure out how to solve a small problem (well, not for me), surely somebody can help me in few seconds.
I have a series of strings in a vector X of the type "xxx", "yyy", "zzz", "IgA", "IgG", "kkk", "IgM", "aaa".
I want to substitute every ENTIRE string beginning with "Ig" with
2011 Apr 07
1
Two questions about metacharacter in regexprs and function return
for the script, please kindly see the script below. At line 10 and line 13,
my problems occurs.
The first one is I try to retrieve the gene official name from a column of a
table. The pattern of official name is something starting with gene_name.
For detail problems, please see the according lines.
Any suggestions are appreciated
example of matching source (extract the Nnat, sometime it would
2014 Apr 24
1
The regular expressions in compareVersion()
Hi,
I guess the backslash should not be used as the separator for
strsplit() in compareVersion(), because the period in [.] is no longer
a metacharacter (no need to "escape" it using a backslash):
https://github.com/wch/r-source/blob/trunk/src/library/utils/R/packages.R#L866-L867
> compareVersion
function (a, b)
{
....
a <- as.integer(strsplit(a, "[\\.-]")[[1L]])
2001 Apr 26
1
list.files wildcard
Hello all,
I have a simple question:
I have filenames that look like these:
"n031ku09.10msmeanc" "n031ku10.10msmeanc" "n031ku11.10msmeanc"
[22] "n031ku12.10msmeanc" "n031ti01.10msmeanc" "n031ti02.10msmeanc"
I also have a set of the same without the "c" at the end.
When I run list.files(".",
2005 May 23
1
Backslash
Why sometimes one has to put a double
backslash in regular expressions, but
often simple backslashes work too?
Is only a \ required for giving a
metacharacter its usual meaning?
---------------------------------------
u=grep('\\{[\\-u]x',a,perl=T)
# equivalent to
u=grep('\{[\-u]x',a,perl=T)
# but
u=grep('\w',a,perl=T)
# is not correct and requires
2008 Nov 08
3
Parsing regular expressions differently - feature request
Hi there,
I rejoiced when I realized that you can use Perl regex from within R. However,
as the FAQ states "Some functions, particularly those involving regular
expression matching, themselves use metacharacters, which may need to be
escaped by the backslash mechanism. In those cases you may need a quadruple
backslash to represent a single literal one. "
I was wondering if that is
2007 Jan 03
3
pb in regular expression with the character "-" (PR#9437)
Full_Name: FAN
Version: 2.4.0
OS: Windows
Submission from: (NULL) (159.50.101.9)
These are expected:
> grep("[\-|c]", c("a-a","b"))
[1] 1
> gsub("[\-|c]", "&", c("a-a","b"))
[1] "a&a" "b"
but these are strange:
> grep("[d|\-|c]", c("a-a","b"))
integer(0)
2008 Dec 24
1
Question About Samba version 3.0.28-1.e15_2.1
I can't open a file (on our samba server) using Actis,
When I troubleshoot the problem using Wireshark, see SMB protocol using
FIND_FIRST2 and filename using obscure Windows metacharacters, e.g.
USAARG03V>>A.SWK
, which gives STATUS_NO_SUCH_FILE (Samba is interpreting the name
literally)
But if the files are copied to a local drive Actis can find them.
Thanks for your
2013 Dec 09
1
[PATCH] sysprep: mention globbing in help for --delete
Followup of ed4bcb119cb908e98ecc1107dcd8b740ee2f484f.
---
sysprep/sysprep_operation_delete.ml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sysprep/sysprep_operation_delete.ml b/sysprep/sysprep_operation_delete.ml
index 59d5485..3db3f57 100644
--- a/sysprep/sysprep_operation_delete.ml
+++ b/sysprep/sysprep_operation_delete.ml
@@ -40,7 +40,12 @@ let op = {
2024 Aug 02
2
grep
Good Morning. Below I like statement like
j<-grep(".r\\b",colnames(mydata),value=TRUE); j
with the \\b option which I read long time ago which Ive found useful.
Are there more or these options, other than ? grep? Thanks.
dstat is just my own descriptive routine.
> x
?[1] "age"????????? "sleep"??????? "primary"????? "middle"
?[5]