In article 19de1d6e-5ba9-42b5-9221-ed7246e39...@u36g2000prn.googlegroups.com,
Oltmans rolf.oltm...@gmail.com wrote:
I've written this regex that's kind of working
re.findall(\w+\s*\W+amazon_(\d+),str)
but I was just wondering that there might be a better RegEx to do that
same thing. Can you
# http://gist.github.com/271661
import lxml.html
import re
src =
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
hello, my age is 86 years old and I was born in 1945. Do you know
that
PI is roughly 3.1443534534534534534
On 21.12.2009 12:38, Oltmans wrote:
Hello,. everyone.
I've a string that looks something like
lksjdflsdiv id ='amazon_345343' kdjff lsdfs/div sdjflsdiv id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits within the ID attribute. For
how about re.findall(r'\w+.=\W\D+(\d+)?',str) ?
this will work for any string within id !
~Ukanth
On Dec 21, 6:06 pm, Oltmans rolf.oltm...@gmail.com wrote:
On Dec 21, 5:05 pm, Umakanth cum...@gmail.com wrote:
How about re.findall(r'\d+(?:\.\d+)?',str)
extracts only numbers from any
On Dec 21, 5:38 am, Oltmans rolf.oltm...@gmail.com wrote:
Hello,. everyone.
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits
Hello,. everyone.
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits within the ID attribute. For
example, required output from above
How about re.findall(r'\d+(?:\.\d+)?',str)
extracts only numbers from any string
~uk
On Dec 21, 4:38 pm, Oltmans rolf.oltm...@gmail.com wrote:
Hello,. everyone.
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
=
On Dec 21, 7:38 pm, Oltmans rolf.oltm...@gmail.com wrote:
Hello,. everyone.
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits
Oltmans wrote:
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits within the ID attribute. For
example, required output from
On Dec 21, 5:05 pm, Umakanth cum...@gmail.com wrote:
How about re.findall(r'\d+(?:\.\d+)?',str)
extracts only numbers from any string
Thank you. However, I only need the digits within the ID attribute of
the DIV. Regex that you suggested fails on the following string
lksjdfls div id
Ok. how about re.findall(r'\w+_(\d+)',str) ?
returns ['345343', '35343433', '8898', '8898'] !
On Dec 21, 6:06 pm, Oltmans rolf.oltm...@gmail.com wrote:
On Dec 21, 5:05 pm, Umakanth cum...@gmail.com wrote:
How about re.findall(r'\d+(?:\.\d+)?',str)
extracts only numbers from any string
Oltmans wrote:
Hello,. everyone.
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits within the ID attribute. For
example, required
Oltmans wrote:
I've a string that looks something like
lksjdfls div id ='amazon_345343' kdjff lsdfs /div sdjfls div id
= amazon_35343433sdfsd/divdiv id='amazon_8898'welcome/div
From above string I need the digits within the ID attribute. For
example, required output from
Hi all,
I am using python to drive another tool using pexpect. The values
which I get back I would like to automatically put into a list if there
is more than one return value. They provide me a way to see that the
data is in set by parenthesising it.
This is all generated as I said using
rh0dium [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all,
I am using python to drive another tool using pexpect. The values
which I get back I would like to automatically put into a list if there
is more than one return value. They provide me a way to see that the
data is in
Paul McGuire wrote:
-- Paul
(Download pyparsing at http://pyparsing.sourceforge.net.)
Done.
Hey this is pretty cool! I have one small problem that I don't know
how to resolve. I want the entire contents (whatever it is) of line 1
to be the ident. Now digging into the code showed a method
rh0dium [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Paul McGuire wrote:
-- Paul
(Download pyparsing at http://pyparsing.sourceforge.net.)
Done.
Hey this is pretty cool! I have one small problem that I don't know
how to resolve. I want the entire contents (whatever it
rh0dium wrote:
Hi all,
I am using python to drive another tool using pexpect. The values
which I get back I would like to automatically put into a list if there
is more than one return value. They provide me a way to see that the
data is in set by parenthesising it.
...
CAN SOMEONE
Paul McGuire wrote:
ident = Combine( Word(alpha,alphanums+_) + LPAR + RPAR )
This will only work for a word with a parentheses ( ie. somefunction()
)
If you *really* want everything on the first line to be the ident, try this:
ident = Word(alpha,alphanums+_) + restOfLine
or
ident =
Michael Spencer wrote:
def parse(source):
... source = source.splitlines()
... original, rest = source[0], \n.join(source[1:])
... return original, rest_eval(get_tokens(rest))
This is a very clean and elegant way to separate them - Very nice!! I
like this alot - I will
rh0dium [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Paul McGuire wrote:
ident = Combine( Word(alpha,alphanums+_) + LPAR + RPAR )
This will only work for a word with a parentheses ( ie. somefunction()
)
If you *really* want everything on the first line to be the ident, try
rh0dium wrote:
Michael Spencer wrote:
def parse(source):
... source = source.splitlines()
... original, rest = source[0], \n.join(source[1:])
... return original, rest_eval(get_tokens(rest))
This is a very clean and elegant way to separate them - Very nice!! I
like
22 matches
Mail list logo