search for: metacharacters

Displaying 20 results from an estimated 94 matches for "metacharacters".

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=&quot...
2008 Aug 22
1
grep, gsub and metacharacters
...T)], "va", myvector) grep identifies the element of the vector that matches my query, but it won't substitute the value. I have been reading the help pages for regular expression, but still can't figure out the syntax to read parenthesis and forward slashes, which are considered metacharacters. As usual, thank you for your help, Judith
2011 Jan 31
0
Reading file names containing Metacharacters
I am trying to read some file names from an specific directory and such names contains metacharacters. The file names is like V4.35_T01-400720.csv In total I have 14 files for which the value T01 goes up to T14. I need to read the files into a string vector that looks like >names"V4.35_T01-400720.csv" "V4.35_T02-400720.csv" ... "V4.35_T14-400720.csv" So far, I hav...
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
2008 Aug 06
1
Matching a period in grep...
...h.csv" Warning messages: 1: '\.' is an unrecognized escape in a character string 2: unrecognized escape removed from "[\.]csv$" R reference for regular expressions says "Any metacharacter with special meaning may be quoted by preceding it with a backslash. [...] The metacharacters in EREs are . \ | ( ) [ { ^ $ * + ?" Am I missing something here? If "\." is not the right way to match a period, can anyone tell me what is? I can't find anything on this in R reference... I'm using R 2.6 on Windows XP Thanks, Alec Zwart CMIS CSIRO alec.zwart at csir...
2015 Feb 14
4
C5 BASH IF
On Fri, 2015-02-13 at 23:46 -0600, Les Mikesell wrote: > I think you are missing some very basic concepts here. First, the > shell likes to parse things separated by white space. Second, [ is a > synonym for test which is a build-in version of /bin/test, so try 'man > test' for the syntax of tests. And third, you generally should use > double quotes around variables in
2019 Jan 25
0
[klibc:update-dash] expand: Do not quote backslashes in unquoted parameter expansion
...to match <0.5.5. > > Ah, sorry. dash 0.5.4 and earlier don't compile on my system, so they > are not included in my conveniently accessible arsenal of test shells. > > > As for my patches, that was by accident and doesn't work reliably. When > > the shell sees no metacharacters, pathname expansion is bypassed, and > > backslash isn't considered a metacharacter. Which got me to my original > > example of /de\v: there are no metacharacters in there, so the shell > > doesn't look to see if it matches anything. Which seems highly > > desirable:...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not quote backslashes in unquoted parameter expansion
...to match <0.5.5. > > Ah, sorry. dash 0.5.4 and earlier don't compile on my system, so they > are not included in my conveniently accessible arsenal of test shells. > > > As for my patches, that was by accident and doesn't work reliably. When > > the shell sees no metacharacters, pathname expansion is bypassed, and > > backslash isn't considered a metacharacter. Which got me to my original > > example of /de\v: there are no metacharacters in there, so the shell > > doesn't look to see if it matches anything. Which seems highly > > desirable:...
2009 Nov 13
6
replace a whole word with sub()
...", "aaa". I can easily identify these strings with grep("^Ig", X), but if I use this criterion in the sub() function (sub("^Ig", "0", X) I obviously get "0A", "0G" etc. I didn't expect to do it in this way and I tried with metacharacters and regexps in order to grep and substitute the whole word (\b \>, $). I don't post here my tryings, because they were obviously wrong. Please can you help me? Giulio _________________________________________________________________ Carica e scarica in un clic. Fino a 25 G...
2023 Dec 18
1
Announce: OpenSSH 9.6 released
...s while specifying destination constraints, if the PKCS#11 token returned multiple keys then only the first key had the constraints applied. Use of regular private keys, FIDO tokens and unconstrained keys are unaffected. * ssh(1): if an invalid user or hostname that contained shell metacharacters was passed to ssh(1), and a ProxyCommand, LocalCommand directive or "match exec" predicate referenced the user or hostname via %u, %h or similar expansion token, then an attacker who could supply arbitrary user/hostnames to ssh(1) could potentially perform command injection de...
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
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 lines down under "EXPANSION". -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJU34eBAAoJEAF3yXsqtyBlNuYP/iPLOPY/SbXeGgpZOnJKZ3qH...
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 really necessary for perl=TRUE? wouldn't it be possible to parse a string differently in a regex context, e.g. aut...
2023 Dec 18
0
Announce: OpenSSH 9.6 released
...s while specifying destination constraints, if the PKCS#11 token returned multiple keys then only the first key had the constraints applied. Use of regular private keys, FIDO tokens and unconstrained keys are unaffected. * ssh(1): if an invalid user or hostname that contained shell metacharacters was passed to ssh(1), and a ProxyCommand, LocalCommand directive or "match exec" predicate referenced the user or hostname via %u, %h or similar expansion token, then an attacker who could supply arbitrary user/hostnames to ssh(1) could potentially perform command injection de...
2015 Feb 14
0
C5 BASH IF
...hanks for that. I assumed if test 1 worked, so would test 2. > > Have re-run test 2 with > > >> 16 if [ $file = "law00css" ] You still missed the part about quoting variables. You quote plain strings to hold embedded spaces together (or single-quotes to avoid parsing metacharacters). You use double quotes around $variables so they don't disappear completely if the variable isn't set, causing a syntax error. 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 e...
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 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 help.
2013 Mar 27
2
find and replace characters in a string
Hi, I have a string of text as follows "LOI ." How do I replace the dot with "(%)" gsub(".","(%)",LOI .) gives "(%)(%)(%)(%)(%)" Thanks -- Shane [[alternative HTML version deleted]]
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]])