On Jun 10, 12:13 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
>
> Here's the code I started
In article ,
504cr...@gmail.com <504cr...@gmail.com> wrote:
>
>MRI scans would no doubt reveal that people who attain a mastery of
>RegEx expressions must have highly developed areas of the brain. I
>wonder where the RegEx part of the brain might be located.
You want Friedl:
http://www.powells.com
On Jun 10, 10:13 am, Peter Otten <__pete...@web.de> wrote:
> 504cr...@gmail.com wrote:
> > I wonder if you (or anyone else) might attempt a different explanation
> > for the use of the special sequence '\1' in the RegEx syntax.
>
> > The Python documentation explains:
>
> > \number
> > Matches
504cr...@gmail.com wrote:
> I wonder if you (or anyone else) might attempt a different explanation
> for the use of the special sequence '\1' in the RegEx syntax.
>
> The Python documentation explains:
>
> \number
> Matches the contents of the group of the same number. Groups are
> numbered
On Jun 10, 5:17 am, Paul McGuire wrote:
> On Jun 9, 11:13 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
>
> > By what method would a string be inserted at each instance of a RegEx
> > match?
>
> Some might say that using a parsing library for this problem is
> overkill, but let me just put
On Jun 10, 5:17 am, Paul McGuire wrote:
> On Jun 9, 11:13 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
>
> > By what method would a string be inserted at each instance of a RegEx
> > match?
>
> Some might say that using a parsing library for this problem is
> overkill, but let me just put
On Jun 9, 11:13 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
Some might say that using a parsing library for this problem is
overkill, but let me just put this out there as another data point for
you. Pypar
504cr...@gmail.com wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Have a look at re.sub():
>>> s = '123 abc 456 def 789 ghi'
>>> re.com
On Jun 9, 11:35 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> On Jun 9, 11:19 pm, Roy Smith wrote:
>
>
>
> > In article
> > ,
>
> > "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > > By what method would a string be inserted at each instance of a RegEx
> > > match?
>
> > > For exampl
On Jun 9, 11:19 pm, Roy Smith wrote:
> In article
> ,
>
> "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > By what method would a string be inserted at each instance of a RegEx
> > match?
>
> > For example:
>
> > string = '123 abc 456 def 789 ghi'
> > newstring = ' INSERT 123 abc INSERT 456 d
In article
,
"504cr...@gmail.com" <504cr...@gmail.com> wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
If you want to do what I think y
By what method would a string be inserted at each instance of a RegEx
match?
For example:
string = '123 abc 456 def 789 ghi'
newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Here's the code I started with:
>>> rePatt = re.compile('\d+\s')
>>> iterator = rePatt.finditer(string)
>>> co
12 matches
Mail list logo