search for: subpattern

Displaying 20 results from an estimated 27 matches for "subpattern".

Did you mean: subpatterns
2019 Feb 20
3
[PATCH 0/2] Cygwin: allow user and group case-insensitive Unicode strings
Windows usernames are case-insensitive and almost any Unicode character is allowed in a username. The user should be able to login with her username given in any case and not be refused. However, this opens up a security problem in terms of the sshd_config Match rules. The match rules for user and group names have to operate case-insensitive as well, otherwise the user can override her settings
2016 Sep 21
2
error handling in strcapture
...3"), proto=list(Name="", Number=0)) Error in strcapture("(.+) (.+)", c("One 1", "noSpaceInLine", "Three 3"), : number of matches does not always match ncol(proto) First, isn't the 'number of matches' the number of parenthesized subpatterns in the regular expression? I thought that if the entire pattern matches then the subpatterns without matches would be shown as matches at position 0 with length 0. Hence either the pattern is compatible with the prototype or it isn't, it does not depend on the text input. E.g., > regexe...
2010 Aug 26
5
Quick GREP challenge
> grep("f[0-9]+=", "f1=5,f22=3,", value = T) [1] "f1=5,f22=3," How do I make the line output c("f1", "f22") instead? (Actually, c(1,22) would be even better). Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Quick-GREP-challenge-tp2339486p2339486.html Sent from the R help mailing list archive at Nabble.com.
2016 Sep 21
2
error handling in strcapture
...t; > Error in strcapture("(.+) (.+)", c("One 1", "noSpaceInLine", "Three > 3"), : > > number of matches does not always match ncol(proto) > > > > First, isn't the 'number of matches' the number of parenthesized > > subpatterns in the regular expression? I thought that if the entire > > pattern matches then the subpatterns without matches would be > > shown as matches at position 0 with length 0. Hence either the > > pattern is compatible with the prototype or it isn't, it does not depend > &gt...
2009 Apr 13
1
should sub(perl=TRUE) also handle \E in replacement, to complement \U and \L?
Currently sub(perl=TRUE) allows you to specify \U and \L in the replacement argument so that the rest of the subpatterns in the line (the \\<digit> things) will be converted to upper or lower case, respectively. perl also also has a \E operator to end these case conversions for the rest of the subpatterns (so they retain whatever case they had in the original text). For symmetry's sake I think it would be...
2016 Apr 15
2
ssh-keygen -R is case-sensitive, but should not be
Here is a better patch. Somehow I pasted an older version of my edits: ------------------------------------------------------- % diff ./match.c /home/millerig/osrc/openssh-7.2p2/match.c 121a122 > char *low_string = 0; 156,159c157,168 < if (match_pattern(string, sub)) { < if (negated) < return -1; /* Negative */ < else --- > if (dolower) { > u_int j; >
2016 Oct 04
2
error handling in strcapture
...quot;One 1", "noSpaceInLine", "Three > 3"), > >> > : > >> > number of matches does not always match ncol(proto) > >> > > >> > First, isn't the 'number of matches' the number of parenthesized > >> > subpatterns in the regular expression? I thought that if the entire > >> > pattern matches then the subpatterns without matches would be > >> > shown as matches at position 0 with length 0. Hence either the > >> > pattern is compatible with the prototype or it isn't,...
2016 Sep 21
2
strcapture enhancement
The new strcapture function in R-devel is handy, capturing the matches to the parenthesized subpatterns in a regular expression in the columns of a data.frame, whose column names and classes are given by the 'proto' argument. E.g., > p1 <- data.frame(Name="", Number=0) > str(strcapture("([[:alpha:]]*) +([[:digit:]]*)", c("Three 3", "Twenty 20&quo...
2016 Oct 04
1
error handling in strcapture
...t; >> > 3"), > >> >> > : > >> >> > number of matches does not always match ncol(proto) > >> >> > > >> >> > First, isn't the 'number of matches' the number of parenthesized > >> >> > subpatterns in the regular expression? I thought that if the > entire > >> >> > pattern matches then the subpatterns without matches would be > >> >> > shown as matches at position 0 with length 0. Hence either the > >> >> > pattern is compatible with...
2016 Sep 21
0
error handling in strcapture
...me="", Number=0)) > Error in strcapture("(.+) (.+)", c("One 1", "noSpaceInLine", "Three 3"), : > number of matches does not always match ncol(proto) > > First, isn't the 'number of matches' the number of parenthesized > subpatterns in the regular expression? I thought that if the entire > pattern matches then the subpatterns without matches would be > shown as matches at position 0 with length 0. Hence either the > pattern is compatible with the prototype or it isn't, it does not depend > on the text input....
2016 Sep 21
0
error handling in strcapture
...ure("(.+) (.+)", c("One 1", "noSpaceInLine", "Three 3"), >> > : >> > number of matches does not always match ncol(proto) >> > >> > First, isn't the 'number of matches' the number of parenthesized >> > subpatterns in the regular expression? I thought that if the entire >> > pattern matches then the subpatterns without matches would be >> > shown as matches at position 0 with length 0. Hence either the >> > pattern is compatible with the prototype or it isn't, it does not dep...
2008 Dec 18
1
[Bug 1546] New: sshd_config DenyUsers does not recognize negated host properly
...the end of the major ``for'' loop in the function. Although the diff is relative to the 5.1p1 version, I encountered the problem working with the 3.9p1 version; the code is consistent in these versions. The meaning of the additional code is the following: - If a string fails to match the subpattern of the configuration, then execution will flow into ``else'' branch. - Normally, the failure of a match is a failure (``got_positive'' retains its initialized value of zero). - However, where a failure is desired (the ``!'' in the specification subpattern), then the occurr...
2008 Dec 16
2
Request change to file match.c, function match_pattern_list
...function ``match_pattern'') near the end of the main ``for'' loop in function ``match_pattern_list'' in file ``match.c''. The diff above is an example of code to handle this case. The meaning of this new code is the following: - If a string fails to match the subpattern of the configuration, then execution will flow into ``else'' branch. - Normally, the failure of a match is a failure (``got_positive'' retains its initialized value of zero). - However, where a failure is desired (the ``!'' in the specification subpattern), then the...
2016 Oct 04
0
error handling in strcapture
...quot;, "Three >> >> > 3"), >> >> > : >> >> > number of matches does not always match ncol(proto) >> >> > >> >> > First, isn't the 'number of matches' the number of parenthesized >> >> > subpatterns in the regular expression? I thought that if the entire >> >> > pattern matches then the subpatterns without matches would be >> >> > shown as matches at position 0 with length 0. Hence either the >> >> > pattern is compatible with the prototype or it...
2012 Oct 11
2
simple parsing question?
I am using the getQuote function in the Quantmod package to retrieve the % change for a stock as follows: > getQuote("aapl",what=yahooQF(c("Change Percent (Real-time)"))) Trade Time %Change (RT) aapl 2012-10-11 03:41:00 N/A - -1.67% How can I extract the numeric "change %" which is being returned as a factor so that I can use it in other
2019 Feb 22
3
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
On Wed, 20 Feb 2019 at 23:54, Corinna Vinschen <vinschen at redhat.com> wrote: > The previous revert enabled case-insensitive user names again. This > patch implements the case-insensitive user and group name matching. > To allow Unicode chars, implement the matcher using wchar_t chars in > Cygwin-specific code. Keep the generic code changes as small as possible. > Cygwin:
2019 Feb 22
2
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
...833709a09e9f 100644 --- a/match.c +++ b/match.c @@ -111,8 +111,6 @@ match_pattern(const char *s, const char *pattern) /* NOTREACHED */ } -#ifndef HAVE_CYGWIN /* Cygwin version in openbsd-compat/bsd-cygwin_util.c */ - /* * Tries to match the string against the * comma-separated sequence of subpatterns (each possibly preceded by ! to @@ -172,7 +170,17 @@ match_pattern_list(const char *string, const char *pattern, int dolower) return got_positive; } +int +match_usergroup_pattern_list(const char *string, const char *pattern) +{ +#ifdef HAVE_CYGWIN + /* Windows usernames may be Unicode and are...
2012 Mar 07
1
gsub: replacing double backslashes with single backslash
Hello everybody, this might be a trivial question, but I have been unable to find this using Google. I am trying to replace double backslashes with single backslashes using gsub. There seems to be some unexpected behaviour with regards to the replacement string "\\". The following example uses the string C:\\ which should be converted to C:\ . > gsub("\\\\",
2002 Aug 02
3
[Bug 377] New: Reduce compiler warnings. Use unsigned args to the ctype.h is*() macros.
...(subi = 0; i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; subi++, i++) - sub[subi] = dolower && isupper(pattern[i]) ? + sub[subi] = dolower && isupper((unsigned)pattern[i]) ? tolower(pattern[i]) : pattern[i]; /* If subpattern too long, return failure (no match). */ if (subi >= sizeof(sub) - 1) Index: scp.c =================================================================== RCS file: /cvs/openssh/scp.c,v retrieving revision 1.97 diff -u -p -r1.97 scp.c --- scp.c 21 Jun 2002 00:41:52 -0000 1.97 +++ scp.c 2 Aug 2002...
2012 Dec 17
2
Formatting a path for unix with gsub
I have a path: path = "/nfs/users/nfs_n/ns9/ Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll trained without akapn+tnik.csv" I wish to replace the spaces with "\ " so that it can be read by a system call to unix. Using gsub I try: > gsub(" ","\\ ",path) [1] "/nfs/users/nfs_n/ns9/Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll