search for: lookbehind

Displaying 9 results from an estimated 9 matches for "lookbehind".

2008 Nov 30
6
Regex: workaround for variable length negative lookbehind
...e repetition doesn't make up the whole word. That is, for the vector vec: vec<-c("aaaa", "baaa", "bbaa", "bbba", "baamm", "aa") I would like to get "baaa" "bbaa" "baamm" >From tools where negative lookbehind can involve variable lengths, one would think this would work: grep("(?<!(?:\\1|^))(.)\\1{1,}$", vec, perl=T) But then R doesn't like it that much ... I also know I can get it like this: whole.word.rep <- grep("^(.)\\1{1,}$", vec, perl=T) # 1 6 rep.at.end <- grep...
2011 Mar 10
0
[LLVMdev] How to make release branch available in git (topic changed)
Hi Tobias, > The following expression e.g. > > /^.*(?<!trunk|RELEASE_2.).$/m > > uses lookbehind to matches on: Thanks. Clever trick, but... Variable length lookbehind not implemented in regex m/^.*(?<!trunk|RELEASE_2.).$/ at /usr/lib/git-core/git-svn line 4078. :( -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
2011 Mar 08
2
[LLVMdev] How to make release branch available in git (topic changed)
...nately, git-svn does not allow this yet. Why not? As far as I understand --ignore-paths takes a perl regular expression. So we could just provide a regular expression that matches on all paths except the ones we want to keep. The following expression e.g. /^.*(?<!trunk|RELEASE_2.).$/m uses lookbehind to matches on: tags/SVA tags/eh-experimental tags/ggreif tags/non-call-eh tags/RELEASE_28 at 115869 branches/Apple branches/PowerPC-A branches/PowerPC-B but not on trunk tags/RELEASE_28 tags/RELEASE_29 tags/RELEASE_27 It probably needs some adjustments to get...
2011 Mar 10
2
[LLVMdev] How to make release branch available in git (topic changed)
On 03/10/2011 02:53 AM, Anton Korobeynikov wrote: > Hi Tobias, > >> The following expression e.g. >> >> /^.*(?<!trunk|RELEASE_2.).$/m >> >> uses lookbehind to matches on: > Thanks. Clever trick, but... > > Variable length lookbehind not implemented in regex > m/^.*(?<!trunk|RELEASE_2.).$/ at /usr/lib/git-core/git-svn line 4078. > > :( I got a new one. Today even with working test case: $cat in.txt tags/SVA tags/eh-experimental t...
2018 Feb 13
1
Help with regular expressions
You can either use positive lookahead/lookbehind - but support for that is a bit flaky. Or write a proper regex, and use backreferences to keep what you need. R > x <- "abc 1,1 ,1 1, x,y 2,3 " R > gsub("(\\d),(\\d)", "\\1.\\2", x, perl = TRUE) [1] "abc 1.1 ,1 1, x,y 2.3 " B. > On Feb 12,...
2011 Mar 08
4
[LLVMdev] [cfe-dev] Reminder: LLVM 2.9 Branching in One Week
Hi David > I think the trouble with branches is the lockdown of the root repository > directory. Surely not (at the server) > git svn init --stdlayout https://<user>@llvm.org/svn/llvm-project/llvm \ >
2008 Feb 03
4
Extract vowels and consonants using Ruby Regex
Hello, I am trying to build a regex to extract vowels and consonants from a string. So far, I am able to extract the basic a-e-i-o-u sequence using the following extension to the String class: class String def vowels scan(/[aeiou]/i) end def consonants scan(/[^aeiou]/i) end end examples: >> "Mary had a little lamb".vowels => aaaiea >> "Mary had a
2018 Feb 13
0
Help with regular expressions
Hi Dennis, How about: # define the two values to search for x<-2 y<-3 # create your search string and replacement string repstring<-paste(x,y,sep=",") newstring<-paste(x,y,sep=".") # this is the string that you want to change thetastring<-"SIGMA(2,3)" sub(repstring,newstring,thetastring) [1] "SIGMA(2.3)" Use gsub if you want to change
2018 Feb 13
3
Help with regular expressions
R 3.4.2 OS X Colleagues I would appreciate some help with regular expressions. I have string that looks like: " ITERATION ,THETA1 ,THETA2 ,THETA3 ,THETA4 ,THETA5 ,THETA6 ,THETA7 ,SIGMA(1,1) ,SIGMA(2,1) ,SIGMA(2,2)? In the entries that