Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1964

Re: Regexp help

From mike <mikaelpetterson@hotmail.com>
Newsgroups comp.lang.java.help
Subject Re: Regexp help
Date 2012-08-07 22:14 -0700
Organization http://groups.google.com
Message-ID <e8fd1c92-6f54-48ee-8cc9-ec5a10d03ce5@googlegroups.com> (permalink)
References <3e0aa0ea-bdb5-4cd5-bdae-4fcd31c70a7f@googlegroups.com> <jVfUr.51896$ls7.32117@newsfe11.iad>

Show all headers | View raw


On Tuesday, August 7, 2012 11:38:21 PM UTC+2, Daniel Pitts wrote:
> On 8/7/12 7:03 AM, mike wrote:
> 
> > Hi,
> 
> >
> 
> > I have the following:
> 
> >
> 
> > Input 1: Needs Merge "." [(automatic) to \main\2 from \main\rel1\2 (base also \main\2)]
> 
> >
> 
> > Input 2: Needs Merge "./update" [to /main/4 from /main/bugfix/1 base /main/2]
> 
> >
> 
> > I have the following regexp:
> 
> >
> 
> > Needs\s+Merge\s+\"(.*)\"\s+\[(\(automatic\)\s)?to\s+(.*)\s+from\s+(.*)\s+\(?base\s{1}(also\s{1})?(.*)\]
> 
> >
> 
> > The last grouping (6) is:
> 
> >
> 
> > Input 1: \main\2)
> 
> >
> 
> > Input 2: /main/2
> 
> >
> 
> > How can I avoid get the parenthesis to be included in group(6) for input 1?
> 
> 
> 
> How about adding a \) after your group 6?

I tried it and it works for input #1 but not for #2.
> 
> 
> 
> or replacing your .* with [^)]*

I tried it and it works for input #2 but not for input #1.


What I need is a regexp that works for both input.
> 
> 
> 
> Either of those should solve the problem. Each has different trade-offs 
> 
> depending on your typical input.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Regexp help mike <mikaelpetterson@hotmail.com> - 2012-08-07 07:03 -0700
  Re: Regexp help Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-08-07 14:38 -0700
    Re: Regexp help mike <mikaelpetterson@hotmail.com> - 2012-08-07 22:14 -0700
      Re: Regexp help Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-08-08 09:11 -0700
        Re: Regexp help markspace <-@.> - 2012-08-08 10:16 -0700
          Re: Regexp help Gene Wirchenko <genew@ocis.net> - 2012-08-08 12:13 -0700
            Re: Regexp help markspace <-@.> - 2012-08-08 14:15 -0700
              Re: Regexp help Gene Wirchenko <genew@ocis.net> - 2012-08-08 18:43 -0700

csiph-web