Hello,
I have a TSV file that has the city,state,country information in this
format:
Name Display name Code
San Jose SJC SJC - SJ (POP), CA (US)
San Francisco SFOSFO - SF, CA (US)
I need to extract the state and country for
On 30/9/2013 16:29, Leena Gupta wrote:
Hello,
I have a TSV file that has the city,state,country information in this
format:
Name Display name Code
San Jose SJC SJC - SJ (POP), CA (US)
San Francisco SFOSFO - SF, CA (US)
On 30/09/2013 21:29, Leena Gupta wrote:
Hello,
I have a TSV file that has the city,state,country information in this
format:
Name Display name Code
San Jose SJC SJC - SJ (POP), CA (US)
San Francisco SFOSFO - SF, CA (US)
I
On Fri, 6 Apr 2012, Khalid Al-Ghamdi wrote:
hi all,
I'm trying to extract the domain in the following string. Why doesn't my
pattern (patt) work:
redata
'Tue Jan 14 00:43:21 2020::eax...@gstwyysnbd.gov::1578951801-6-10 Sat Jul 31
15:17:39 1993::rz...@wgxvhx.com::744121059-5-6 Mon Sep 21
I think you can do this:
a=[]
b=redata.split('::')
for e in b:
if e.find('@') != -1:
a.append(e.split('@')[1])
list a includes all the domain
在 2012年4月9日 上午5:26,Wayne Werner wa...@waynewerner.com写道:
On Fri, 6 Apr 2012, Khalid Al-Ghamdi wrote:
hi all,
I'm trying to extract the
Khalid Al-Ghamdi wrote:
I'm trying to extract the domain in the following string. Why doesn't my
pattern (patt) work:
redata
'Tue Jan 14 00:43:21 2020::eax...@gstwyysnbd.gov::1578951801-6-10 Sat Jul
31 15:17:39 1993::rz...@wgxvhx.com::744121059-5-6 Mon Sep 21 20:22:37
I continue working with RegExp, but I have reached a point for wich I can't find
documentation, maybe there is no possible way to do it, any way I throw the
question:
This is my code:
contents = re.sub(r'Á',
A, contents)
contents = re.sub(r'á', a,
contents)
contents = re.sub(r'É',
2011/4/3 Andrés Chandía and...@chandia.net:
I continue working with RegExp, but I have reached a point for wich I can't
find
documentation, maybe there is no possible way to do it, any way I throw the
question:
This is my code:
contents = re.sub(r'Á',
A, contents)
contents =
Hugo Arts wrote:
2011/4/3 Andrés Chandía and...@chandia.net:
I continue working with RegExp, but I have reached a point for wich I
can't find documentation, maybe there is no possible way to do it, any
way I throw the question:
This is my code:
contents = re.sub(r'Á',
A, contents)
Andrés Chandía and...@chandia.net wrote
I'm new to this list, so hello everybody!.
Hi, welcome to the list.
Please do not use reply to start a new thread it confuses threaded
readers and may mean you message will not be seen. Also please
supply a meaningful subject (as above) so we can
On 29-Mar-11 23:55, Alan Gauld wrote:
Andrés Chandía and...@chandia.net wrote
in perl there is a way to reference previous registers,
$text =~ s/u(l|L|n|N)\/u/$1e/g;
I'm looking for the way to do it in python
If you're using just a straight call to re.sub(), it works like this:
Thanks Kushal and Steve.
I think it works,a I say I think because at the
results I got a strange character instead of the letter that should appear
this is
my regexp:
contents = re.sub(r'(u|span style=text-decoration:
underline;)(l|L|n|N|t|T)(/span|/u)', '\2\'' ,contents)
this is my input
On 30-Mar-11 08:21, Andrés Chandía wrote:
Thanks Kushal and Steve.
I think it works,a I say I think because at the
results I got a strange character instead of the letter that should appear
this is
my regexp:
contents = re.sub(r'(u|span style=text-decoration:
Thanks Steve, your are, from now on, my guru
this is the final version, the
good one!
contents = re.sub(r'(u|span style=text-decoration:
underline;)(l|L|n|N|t|T)(/span|/u)', r\2' ,contents)
On Wed, March 30, 2011 17:27, Steve Willoughby wrote:
On 30-Mar-11 08:21,
Andrés Chandía wrote:
I use
regex = .* + search + .*
p = re.compile(regex, re.I)
in finding lines in a text file that contain search, a string entered
at a prompt.
What regex do I use to find lines in a text file that contain search,
where search is a word entered at a prompt?
Thanks,
Dick Moores
On Tue, Jan 4, 2011 at 9:37 AM, Richard D. Moores rdmoo...@gmail.comwrote:
I use
regex = .* + search + .*
p = re.compile(regex, re.I)
in finding lines in a text file that contain search, a string entered
at a prompt.
What regex do I use to find lines in a text file that contain search,
On Tue, Jan 4, 2011 at 07:55, Wayne Werner waynejwer...@gmail.com wrote:
On Tue, Jan 4, 2011 at 9:37 AM, Richard D. Moores rdmoo...@gmail.com
You could use (2.6+ I think):
word = raw_input('Enter word to search for: ')
with open('somefile.txt') as f:
for line in f:
if word in
On Tue, Jan 4, 2011 at 10:37 AM, Richard D. Moores rdmoo...@gmail.com wrote:
regex = .* + search + .*
p = re.compile(regex, re.I)
in finding lines in a text file that contain search, a string entered
at a prompt.
That's an inefficient regex (though the compiler may be smart enough
to prune
On Tue, Jan 4, 2011 at 09:31, Brett Ritter swift...@swiftone.org wrote:
On Tue, Jan 4, 2011 at 10:37 AM, Richard D. Moores rdmoo...@gmail.com wrote:
regex = .* + search + .*
p = re.compile(regex, re.I)
Just having search as your regex is fine (it will search for the
pattern _in_ the string,
On Tue, Jan 4, 2011 at 10:41, Richard D. Moores rdmoo...@gmail.com wrote:
Please see http://tutoree7.pastebin.com/z9YeSYRw . I'm actually
searching RTF files, not TXT files.
I want to modify this script to handle searching on a word. So what,
for example, should line 71 be?
OK, I think I've
On Tue, Jan 4, 2011 at 11:57, Richard D. Moores rdmoo...@gmail.com wrote:
On Tue, Jan 4, 2011 at 10:41, Richard D. Moores rdmoo...@gmail.com wrote:
Please see http://tutoree7.pastebin.com/z9YeSYRw . I'm actually
searching RTF files, not TXT files.
I want to modify this script to handle
On 01/-10/-28163 02:59 PM, Richard D. Moores wrote:
On Tue, Jan 4, 2011 at 11:57, Richard D. Mooresrdmoo...@gmail.com wrote:
On Tue, Jan 4, 2011 at 10:41, Richard D. Mooresrdmoo...@gmail.com wrote:
Please see http://tutoree7.pastebin.com/z9YeSYRw . I'm actually
searching RTF files, not TXT
Dave Angel wrote:
One hazard is if the string the user inputs has any regex special
characters in it. If it's anything but letters and digits you probably
want to escape it before combining it with your \\b strings.
It is best to escape any user-input before passing it to regex
regardless.
On Tue, Jan 4, 2011 at 14:58, Steven D'Aprano st...@pearwood.info wrote:
Dave Angel wrote:
One hazard is if the string the user inputs has any regex special
characters in it. If it's anything but letters and digits you probably want
to escape it before combining it with your \\b strings.
24 matches
Mail list logo