Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-26 Thread Joel Goldstick
On Fri, Oct 26, 2012 at 8:32 AM, Ed Morton wrote: > On 10/25/2012 11:45 PM, Rivka Miller wrote: >> >> Thanks everyone, esp this gentleman. >> >> The solution that worked best for me is just to use a DOT before the >> string as the one at the beginning of the line did not have any char >> before it

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-26 Thread Ed Morton
On 10/25/2012 11:45 PM, Rivka Miller wrote: Thanks everyone, esp this gentleman. The solution that worked best for me is just to use a DOT before the string as the one at the beginning of the line did not have any char before it. That's fine but do you understand that that is not an RE that ma

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-26 Thread Ben Bacarisse
Rivka Miller writes: > Thanks everyone, esp this gentleman. Kind of you to single me out, but it was Janis Papanagnou who first posted the solution that you say "works best" for you. -- Ben. -- http://mail.python.org/mailman/listinfo/python-list

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-26 Thread Asen Bozhilov
Rivka Miller wrote: > I am looking for a regexp for a string not at the beginning of the > line. > > For example, I want to find $hello$ that does not occur at the > beginning of the string, ie all $hello$ that exclude ^$hello$. The begging of the string is zero width character. So you could use n

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-26 Thread Janis Papanagnou
Am 26.10.2012 06:45, schrieb Rivka Miller: Thanks everyone, esp this gentleman. Who is "this"? The solution that worked best for me is just to use a DOT before the string as the one at the beginning of the line did not have any char before it. Which was what I suggested, and where you rude

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Devin Jeanpierre
On Thu, Oct 25, 2012 at 10:00 PM, Ed Morton wrote: > Because there is no solution - there IS no _RE_ that will match a string not > at the beginning of a line. Depending on what the OP meant, the following would both work: - r"^(?!mystring)" (the string does not occur at the beginning) - r"(?!^)

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Rivka Miller
Thanks everyone, esp this gentleman. The solution that worked best for me is just to use a DOT before the string as the one at the beginning of the line did not have any char before it. I guess, this requires the ability to ignore the CARAT as the beginning of the line. I am a satisfied custormer

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread anon
On Thu, 25 Oct 2012 18:08:53 -0700 (PDT), Rivka Miller wrote in <73f60cf3-d932-4366-a405-676748856...@q16g2000yqc.googlegroups.com>: >no one has really helped yet. We regret that you are not a satisfied customer. Please take your receipt to the cashier and you will receive double your money bac

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread David Hutto
On Thu, Oct 25, 2012 at 9:08 PM, Rivka Miller wrote: > On Oct 25, 2:27 pm, Danny wrote: >> Why you just don't give us the string/input, say a line or two, and what you >> want off of it, so we can tell better what to suggest > > no one has really helped yet. > > I want to search and modify. > >

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Mark Lawrence
On 25/10/2012 21:53, Rivka Miller wrote: Hello Programmers, I am looking for a regexp for a string not at the beginning of the line. Why bother with a silly regex thingy when simple string methods will suffice e.g. 'yourstring'.find('xyz', 1) or 'yourstring'.index('xyz', 1) or 'xyz' in

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Ben Bacarisse
Rivka Miller writes: > On Oct 25, 2:27 pm, Danny wrote: >> Why you just don't give us the string/input, say a line or two, and >> what you want off of it, so we can tell better what to suggest > > no one has really helped yet. Really? I was going to reply but then I saw Janis had given you the

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread MRAB
On 2012-10-26 02:08, Rivka Miller wrote: On Oct 25, 2:27 pm, Danny wrote: Why you just don't give us the string/input, say a line or two, and what you want off of it, so we can tell better what to suggest no one has really helped yet. I want to search and modify. I dont wanna be tied to a

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Ed Morton
On 10/25/2012 8:08 PM, Rivka Miller wrote: On Oct 25, 2:27 pm, Danny wrote: Why you just don't give us the string/input, say a line or two, and what you want off of it, so we can tell better what to suggest no one has really helped yet. Because there is no solution - there IS no _RE_ that

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Dave Angel
On 10/25/2012 09:08 PM, Rivka Miller wrote: > On Oct 25, 2:27 pm, Danny wrote: >> Why you just don't give us the string/input, say a line or two, and what you >> want off of it, so we can tell better what to suggest > no one has really helped yet. > > > > first non beginning of the line and I wi

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Rivka Miller
On Oct 25, 2:27 pm, Danny wrote: > Why you just don't give us the string/input, say a line or two, and what you > want off of it, so we can tell better what to suggest no one has really helped yet. I want to search and modify. I dont wanna be tied to a specific language etc so I just want a re

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Zero Piraeus
: On 25 October 2012 16:53, Rivka Miller wrote: > I am looking for a regexp for a string not at the beginning of the > line. There are probably quite a few ways to do this, but '(?>> pattern = re.compile(r"(?>> re.findall(pattern, "this is some text") ['is', 'some', 'text'] -[]z. -- http://ma

Re: Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Janis Papanagnou
On 25.10.2012 22:53, Rivka Miller wrote: > Hello Programmers, > > I am looking for a regexp for a string not at the beginning of the > line. > > For example, I want to find $hello$ that does not occur at the > beginning of the string, ie all $hello$ that exclude ^$hello$. .hello The dot repr

Quickie - Regexp for a string not at the beginning of the line

2012-10-25 Thread Rivka Miller
Hello Programmers, I am looking for a regexp for a string not at the beginning of the line. For example, I want to find $hello$ that does not occur at the beginning of the string, ie all $hello$ that exclude ^$hello$. In addition, if you have a more difficult problem along the same lines, I woul