similar to: invalid regular expression after many grep's (PR#691)

Displaying 20 results from an estimated 8000 matches similar to: "invalid regular expression after many grep's (PR#691)"

2017 Oct 10
0
Regular expression help
How about this (I'm showing it as a pipe because it's easier to read that way): library(magrittr) "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" %>% ? strsplit(' ') %>% ? unlist %>% ? sub('^[^/]*/*','',.) %>% ? sub('^[^/]*/*','',.) %>% ? paste(collapse = ' ') Georges Monette -- Georges Monette,
2017 Oct 09
0
Regular expression help
Hi Duncan, why not split on / and take the correct elements? It is not as elegant as regex but could do the trick. Best, Ulrik On Mon, 9 Oct 2017 at 17:03 Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > I have a file containing "words" like > > > a > > a/b > > a/b/c > > where there may be multiple words on a line (separated by spaces). The
2012 Nov 08
3
strsplit with invalid regular expression
Hi all, > diff_operator <- "\\(" > strsplit(cond, diff_operator) [[1]] [1] "andsin" "log_angle_1_4)" > diff_operator <- "\\sin(" > strsplit(cond, diff_operator) Error in strsplit(cond, diff_operator) : invalid regular expression '\sin(', reason 'Missing ')'' When I am going to split with "("
2017 Oct 09
8
Regular expression help
I have a file containing "words" like a a/b a/b/c where there may be multiple words on a line (separated by spaces).? The a, b, and c strings can contain non-space, non-slash characters. I'd like to use gsub() to extract the c strings (which should be empty if there are none). A real example is "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" which
2017 Aug 16
3
Problem with a regular expression.
Hi... I have come upon a problem with a regular expression which causes base-R to freeze. I have reproduced the phenomenon on several machines running R under Windows 10, and also under OSX on different Apple MACs. The minimal example is:- Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B" The regular expression is
2009 Jun 03
2
Regular expression \ String Extraction help
Dear all, Is there a good way of doing the following conversion: [YYYY]-[MM]-[DD] [Time] [Day] [Name][Integer].[Extention] to become C:\test\[Name]\[YYYY]-[MM]-[DD] [Time] [Day]\[YYYY]-[MM]-[DD] [Time] [Day] [Name][Integer].[Extention] i.e. these 2009-04-10 1400 Fri Foo1.txt 2009-04-10 1400 Fri Universities2.txt 2009-04-10 1400 Fri Hitchhikers Guide To The Galaxy42.txt will become
2009 Mar 03
4
regular expression question
can someone show me how to use a regular expression to break the string at the bottom up into its three components : (-0.791,-0.263] (-38,-1.24] (0.96,2.43] I tried to use strplit because of my regexpitis ( it's not curable. i've been to many doctors all over NYC. they tell me there's no cure ) but it doesn't work because there also dots inside the brackets. Thanks.
2017 Aug 17
2
Problem with a regular expression.
I tried this on a Linux (Ubuntu) server invoking R from the command line and the result was the same, except that I could kill the R session from another terminal window. From: Rui Barradas <ruipbarradas at sapo.pt> To: Chris Triggs <cm.triggs at auckland.ac.nz>; "r-devel at r-project.org" <r-devel at r-project.org> Cc: Thomas Lumley <t.lumley at
2011 Apr 12
2
regular expression question
Dear R People: I have a data frame with the following column names: > names(funky) [1] "UHD.1" "UHD.2" "UHD.3" "UHD.4" "L..W..1" "L..W..2" "L..W..3" [8] "L..W..4" "B..W..1" "B..W..2" "B..W..3" "B..W..4" "W..B..1" "W..B..2" [15]
2017 Aug 17
1
Problem with a regular expression.
The issue seems related to R bug report 15012: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15012 As mentioned in the comments there, a pull request to the TRE library has recently been made, but I don't know about its status. Daniel ________________________________________ Von: R-devel <r-devel-bounces at r-project.org> im Auftrag von Tomas Kalibera <tomas.kalibera at
2009 Jul 08
5
R regular expression to extract words with the query string.
Hi, Is there a way in R to get the string which matches the expression, where the expression is a substring of the parent string. Lets say, I have $i <- "transcript:ENST0000112334 pid:ENSP000012345" What I need is the string "pid:ENSP000012345" from $i using the query "ENSP". Appreciate your comments. Praveen Surendran School of Medicine and
2011 Jun 05
1
Negating two identical characters with regular expressions
Hello all, Let's say I have a character string "Race-ethnicity-----coding information" I want to extract all text before the multiple dashes, including the word "ethnicity." I wrote a handy function to extract the first matched text: grepcut <- function(pattern,x){ start.and.length <- regexpr(pattern,x) substring(x,start.and.length,start.and.length
2012 Feb 29
3
regular expression
Computer Friends, with the following example lines: [107] "98-610: Cell type: S; Surv(months): 6; STATUS(0=alive, 1=dead): 1" [108] "99-625: Cell type: S; Surv(months): 21; STATUS(0=alive, 1=dead): 1" i want to be able to isolate the number of months of survival for each row. is there a regular expression that can find the first instance of a ";", delete
2010 Jun 25
3
gsub with regular expression
If I have a text with 7 words per line and I would like to put first and second word joined in a vector and the rest of words one per column in a matrix how can I do it? First 2 lines of my text file: "2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido" "2010/02/01 02:35:31 palabra 111.111.222 abejorro Rodeo Vaca" Results: Vector: 2008/12/31 12:23:31 2010/02/01 02:35:31
2008 May 13
3
Regular Expressions
Hi R, Again struck with regular expressions... Suppose, S=c("World_is_beautiful", "one_two_three_four","My_book") I need to extract the last but one element of the strings. So, my output should look like: Ans=c("is","three","My") gsub() can do this...but wondering how do I give the regular expression....
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]])
2008 May 01
2
regular expression question
I have strings of the form TICKER.GGG.XXXXXX.dat but GGG is not always three characters so I can't use substr to pull it out of the string. Could someone tell me how to use sub to pull out the GGG but more generally the string between the dot after the R in TICKER and the next dot. I still don't have a very good understanding of regular expressions but I'm trying to get that
2008 Mar 06
1
invalid regular expression '[a-Z]'
Hi, just curious, but does anyone know the source/reason of observing the following error on OSX but not on WinXP and Linux? I've tried with a few different versions of R (v2.5.1, v2.6.1, v2.6.2, v2.7.0devel). The locale does not seem to affect the error, i.e. I've tested a few different and it is still only OSX that gives the error but not the other two. > regexpr("[a-Z]",
2010 Mar 31
3
regular expression help to extract specific strings from text
Dear all, Lets say I have the following: > x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at statistics that #Excel ever was! @Cain & @Able disagree though :(", "Adam: @Eve I'm sure they'll sort it out :)", "blahblah") > x [1]
2012 Aug 21
7
Regular Expressions in grep
Dear r-help members, I have a number in the form of a string, say: a<-"-01020.909200" I'd like to extract "1020." as well as ".9092" Front<-grep(pattern="[1-9]+[0-9]*\\.", value=TRUE, x=a, fixed=FALSE) End<-grep(pattern="\\.[0-9]*[1-9]+", value=TRUE, x=a, fixed=FALSE) However, both strings give "-01020.909200", exactly