?
the
is
name
Second, get a charactor in each word and compose like format {'t','h','e'}
for a in line
Most import is learning the regular expressions var this example.
Okay, then I'll go into that part.
regex = re.compile(line([^]*)/line)
[^] here means any character but or
* means that we have any
Hi,
So I m trying to use a very large regular expression, basically I have
a list of items I want to find in text, its kind of a conjunction of
two regular expressions and a big list..not pretty. However
everytime I try to run my code I get this exception:
OverflowError: regular expression
Nathan Harmston, 15.03.2010 13:21:
So I m trying to use a very large regular expression, basically I have
a list of items I want to find in text, its kind of a conjunction of
two regular expressions and a big list..not pretty. However
everytime I try to run my code I get this exception
Nathan Harmston iwanttobeabad...@googlemail.com writes:
[...]
Could anyone suggest other methods of these kind of string matching in
Python? I m trying to see if my swigged alphabet trie is faster than
whats possible in Python!
Since you mention using a trie, I guess it's just a big
Nathan Harmston wrote:
Hi,
So I m trying to use a very large regular expression, basically I have
a list of items I want to find in text, its kind of a conjunction of
two regular expressions and a big list..not pretty. However
everytime I try to run my code I get this exception
Wes James wrote:
On Wed, Feb 24, 2010 at 5:03 AM, Jonathan Fine j.f...@open.ac.uk wrote:
Hi
Does anyone know of a collection of regular expressions that will break a
TeX/LaTeX document into tokens? Assume that there is no verbatim or other
category code changes.
I'm not sure how this does
Hi
Does anyone know of a collection of regular expressions that will break
a TeX/LaTeX document into tokens? Assume that there is no verbatim or
other category code changes.
Thanks
Jonathan
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 24, 2010 at 5:03 AM, Jonathan Fine j.f...@open.ac.uk wrote:
Hi
Does anyone know of a collection of regular expressions that will break a
TeX/LaTeX document into tokens? Assume that there is no verbatim or other
category code changes.
I'm not sure how this does it, but it might
What does this line do?...
input_ = re.sub(([a-zA-Z]+), '\\1', input_)
Does it remove parentheses from words?
e.g. (foo) - foo ???
I'd like to replace [a-zA-Z] with \w but \w makes it blow up.
In other words, re.sub((\w+), '\\1', input_) blows up.
Why?
cs
--
Chris Seberino wrote:
What does this line do?...
input_ = re.sub(([a-zA-Z]+), '\\1', input_)
Does it remove parentheses from words?
e.g. (foo) - foo ???
I'd like to replace [a-zA-Z] with \w but \w makes it blow up.
In other words, re.sub((\w+), '\\1', input_) blows up.
Why?
cs
( has a
Chris Seberino wrote:
What does this line do?...
input_ = re.sub(([a-zA-Z]+), '\\1', input_)
Why don't you try it?
Does it remove parentheses from words?
e.g. (foo) - foo ???
No, it puts quotes around them.
I'd like to replace [a-zA-Z] with \w but \w makes it blow up.
In other words,
Changes by Tarek Ziadé ziade.ta...@gmail.com:
--
resolution: - accepted
title: cygwincompiler regular expressions broken - cygwinccompiler regular
expressions broken
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6438
Tarek Ziadé ziade.ta...@gmail.com added the comment:
done in r73975, r73976
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6438
___
New submission from Tarek Ziadé ziade.ta...@gmail.com:
The regular expressions used in distutils to build a extension using the
mingw32 compiler are messed up because they try to work with bytes
(since Popen behavior changed) using string patterns.
I have to cleanup these regular expressions
Georg Brandl ge...@python.org added the comment:
Committed a similar patch in r70866.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4882
___
==
re-try
==
:version: 0.7
URL
---
http://re-try.appspot.com/
what is it
--
A small online browser application to try out Python regular expressions.
It is based on http://cthedot.de/retest/ which has been around for some
years but I never had a Python hosting service
Peter Waller peter.wal...@gmail.com added the comment:
It looks like Matthew has dropped this feature from consideration.
See msg83993 .
--
nosy: +pwaller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue694374
whether any particular change will be accepted.
2. I think that recursive regular expressions are starting to stray into
the realm of pyparsing and so forth.
So I might not have the time (and I don't think I have the inclination!)
to implement them
Hi,
Every so often the group gets a request for parsing an expression. I
think it would be significantly easier to do if regular expressions
could modify a stack. However, since you might nearly as well write
Python, maybe there is a compromise.
Could the Secret Labs' regular expression engine
2009/3/22 Aaron Brady castiro...@gmail.com:
Hi,
Every so often the group gets a request for parsing an expression. I
think it would be significantly easier to do if regular expressions
could modify a stack. However, since you might nearly as well write
Python, maybe there is a compromise
On Mar 22, 12:18 pm, Chris Rebert c...@rebertia.com wrote:
2009/3/22 Aaron Brady castiro...@gmail.com:
Hi,
Every so often the group gets a request for parsing an expression. I
think it would be significantly easier to do if regular expressions
could modify a stack. However, since you
alec resnick aresnick...@gmail.com added the comment:
Hi Georg!
Sorry to be so long in getting back to you. I've attached a suggested
patch for the python-2.6.1-docs-text/library/re.txt documentation.
Also, in looking over Kuchling's HOWTO, the necessary information is
actually there, and I
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group.
This expression works ok: '^(Update:)?(.*)(\(.*\))$' - it returns
(Update, New item, (Household))
Some
On Feb 7, 11:18 pm, LaundroMat laun...@gmail.com wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group.
This expression works ok: '^(Update
LaundroMat wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group.
This expression works ok: '^(Update:)?(.*)(\(.*\))$' - it returns
(Update, New item
On Feb 8, 1:37 am, MRAB goo...@mrabarnett.plus.com wrote:
LaundroMat wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group.
This expression
John Machin wrote:
On Feb 8, 1:37 am, MRAB goo...@mrabarnett.plus.com wrote:
LaundroMat wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group
On Feb 8, 10:15 am, MRAB goo...@mrabarnett.plus.com wrote:
John Machin wrote:
On Feb 8, 1:37 am, MRAB goo...@mrabarnett.plus.com wrote:
LaundroMat wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally
John Machin wrote:
On Feb 8, 10:15 am, MRAB goo...@mrabarnett.plus.com wrote:
John Machin wrote:
On Feb 8, 1:37 am, MRAB goo...@mrabarnett.plus.com wrote:
LaundroMat wrote:
Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings
confronted with a problem, think I know, I'll use
regular expressions. Now they have two problems.'
--Jamie Zawinski, comp.emacs.xemacs, 8/1997
Although there are times when regexes are your best option, Python has
many other good options for processing strings, and your code readability
will usually
Georg Brandl ge...@python.org added the comment:
I'm happy to review such a patch.
--
priority: - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4882
___
Hi,
I have a question about relative performance of comparable regular expressions.
I have large log files that start with three letters month names (non-unicode).
Which would give better performance, matching with ^[a-zA-Z]{3}, or with
^\S{3} ?
Also, which is better (if different at all): \d
On Jan 13, 7:24 pm, Barak, Ron ron.ba...@lsi.com wrote:
Hi,
I have a question about relative performance of comparable regular
expressions.
I have large log files that start with three letters month names
(non-unicode).
Which would give better performance, matching with ^[a-zA-Z]{3
John Machin wrote:
On Jan 13, 7:24 pm, Barak, Ron ron.ba...@lsi.com wrote:
Hi,
I have a question about relative performance of comparable regular
expressions.
I have large log files that start with three letters month names
(non-unicode).
Which would give better performance, matching
performance of comparable regular expressions
On Jan 13, 7:24 pm, Barak, Ron ron.ba...@lsi.com wrote:
Hi,
I have a question about relative performance of comparable regular
expressions.
I have large log files that start with three letters month names
(non-unicode).
Which would give better
: John Machin [
]
Sent: Tuesday, January 13, 2009 11:15
To: python-list@python.org
Subject: Re: Relative performance of comparable regular expressions
On Jan 13, 7:24 pm, Barak, Ron ron.ba...@lsi.com wrote:
Hi,
I have a question about relative performance of comparable regular
expressions.
I
Jim Jewett jimjjew...@users.sourceforge.net added the comment:
That sounds like a good idea, particularly since it is a bit different
from Perl. Please do write up the a clarification.
Typically, I have either attached a file with the suggested wording, or
included it in a comment from which
New submission from alec resnick aresnick...@gmail.com:
I recently learned about named groups in Python regular expressions.
Almost all the documentation I've found online explains what they are
and give a simple example of how to use them. I was trying to use the
variables outside
Hi, all. As a recovering Perl guy, I have to admit I don't quite get
the re module. For example, I'd like to do a few things (I'm going to use
phone numbers, 'cause that's what I'm currently dealing with):
12345678900 -- How would I:
- Get just the area code?
- Get just the seven-digit number?
On Thu, Jan 8, 2009 at 8:54 AM, Ken D'Ambrosio ken.dambro...@segway.com wrote:
Hi, all. As a recovering Perl guy, I have to admit I don't quite get
the re module. For example, I'd like to do a few things (I'm going to use
phone numbers, 'cause that's what I'm currently dealing with):
Ken D'Ambrosio wrote:
Hi, all. As a recovering Perl guy, I have to admit I don't quite
get the re module. For example, I'd like to do a few things (I'm
going to use phone numbers, 'cause that's what I'm currently dealing
with):
12345678900 -- How would I:
- Get just the area code?
- Get
Ken D'Ambrosio wrote:
Hi, all. As a recovering Perl guy,
[snip]
In Perl, I'd so something like
m/^1(...)(...)/;
Indeed it seems you are recovering from an especially bad case. I
recommend two doses of the python cookbook per day for one to two
months. Report back here after your first
On Thu, Jan 8, 2009 at 10:03 AM, James Stroud jstr...@mbi.ucla.edu wrote:
(...)
Indeed it seems you are recovering from an especially bad case. I recommend
two doses of the python cookbook per day for one to two months. Report back
here after your first cycle and we'll tell you how you are
Ken D'Ambrosio:
But the Python stuff simply isn't clicking for me.
For people coming from Perl that want to perform some string
processing with Python I suggest to learn first array/string slices
and string methods. And to try to use the regular expressions as
little as possible.
Bye
Hi, all. As a recovering Perl guy, I have to admit I don't quite get
the re module. For example, I'd like to do a few things (I'm going to use
phone numbers, 'cause that's what I'm currently dealing with):
12345678900 -- How would I:
- Get just the area code?
- Get just the seven-digit number?
) = phone_number_match.groups()
area_code
'234'
local_number
'5678900'
Python regular expressions also allow naming each group, for later
access to the matches via a dict:
phone_number_regex = '^1(?Parea_code\d{3})(?Plocal_number\d{7})'
phone_number_pattern = re.compile
On 07Jan2009 19:51, Ken D'Ambrosio k...@jots.org wrote:
| Hi, all. As a recovering Perl guy, I have to admit I don't quite get
| the re module. For example, I'd like to do a few things (I'm going to use
| phone numbers, 'cause that's what I'm currently dealing with):
| 12345678900 -- How would
I apologize in advance for the newbie question. I'm trying to figure
out a way to find all of the occurrences of a regular expression in a
string including the overlapping ones.
For example, given the string 123456789
I'd like to use the RE ((2)|(4))[0-9]{3} to get the following matches:
2345
On Nov 20, 4:31 pm, Ben [EMAIL PROTECTED] wrote:
I apologize in advance for the newbie question. I'm trying to figure
out a way to find all of the occurrences of a regular expression in a
string including the overlapping ones.
For example, given the string 123456789
I'd like to use the RE
On 18 Nov., 18:47, Stefan Behnel [EMAIL PROTECTED] wrote:
Kay Schluehr wrote:
All of this is prototyped in Python and it is still work in progress.
As long as development has not reached a stable state I refuse to
rebuild the system in an optimized C version.
And rightfully so:
1) the
Uwe Schmitt wrote:
Are there any plans to speed up Pythons regular expression module ?
Or
is the example in this artricle too far from reality ???
http://regex.info/blog/2006-09-15/247
--
http://mail.python.org/mailman/listinfo/python-list
On 17 Nov., 22:37, Uwe Schmitt [EMAIL PROTECTED] wrote:
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html
?
Are there any plans to speed up Pythons regular expression module ?
Or
is the example in this artricle too far from reality ???
Greetings, Uwe
Some
Kay Schluehr wrote:
All of this is prototyped in Python and it is still work in progress.
As long as development has not reached a stable state I refuse to
rebuild the system in an optimized C version.
And rightfully so:
1) the approach is algorithmically better, so it may even beat the
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html
?
Are there any plans to speed up Pythons regular expression module ?
Or
is the example in this artricle too far from reality ???
Greetings, Uwe
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt
[EMAIL PROTECTED] wrote:
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ?
Yes, it's been brought up here, on python-dev and python-ideas several
times in the past year and a half.
Are there any plans to speed up
Uwe Schmitt wrote:
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html
?
Near the end:
While writing the text editor sam [6] in the early 1980s, Rob Pike wrote
a new regular expression implementation, which Dave Presotto extracted
into a library that appeared in
Jerry Hill wrote:
On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt
[EMAIL PROTECTED] wrote:
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ?
Yes, it's been brought up here, on python-dev and python-ideas several
times in the past year and a half.
Are there any
On Nov 17, 10:24 pm, Terry Reedy [EMAIL PROTECTED] wrote:
Jerry Hill wrote:
On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt
[EMAIL PROTECTED] wrote:
Hi,
Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html?
Yes, it's been brought up here, on python-dev and
a pathological case. There are some known cases of horrible behaviour
that are explained in many books on regular expressions. If you avoid
those constructs when writing the RE, you're reasonably safe. I for
myself avoid using RE at all :)
--
Gabriel Genellina
--
http://mail.python.org/mailman
Rob Quoting from :
url:http://www.boost.org/doc/libs/1_36_0/libs/regex/doc/html/boost_regex/ref/regex_match.html
Rob quote
Rob Important
Rob Note that the result is true only if the expression matches the
Rob whole of the input sequence. If you want to search for an
A colleague wrote a C++ library here at work which uses the Boost.regex
library. I quickly discovered an apparent problem with how it searches.
Unlike re.match the regex_match function in that library effectively anchors
the match at both the start and the end. Can other people confirm this?
I was confused when I first used Boost regualr expressions,
but I got used to it now. Aside from it, I think Boost regular expression
makes you write too much code just to do a simple pattern matching.
Tomohiro Kusumi
2008/10/23 [EMAIL PROTECTED]
A colleague wrote a C++ library here at work
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
A colleague wrote a C++ library here at work which uses the
Boost.regex library. I quickly discovered an apparent problem with
how it searches. Unlike re.match the regex_match function in that
library effectively anchors the match at
Matthew Barnett [EMAIL PROTECTED] added the comment:
Perl (?number) for calling numbered groups and (?name) for named groups
(Perl also supports (?Pname)). (?R) is equivalent to (?0).
It's interesting that the documentation for both Perl and PCRE say that
they support (?Pname) because that's
I have a regular expression that I use to extract the surname:
surname = r'(?u).+ (\w+)'
However, when I apply it to this Unicode string, I get only the first 3
letters of the surname:
name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k'
surname_re = re.compile(surname)
m = surname_re.search(name)
Jeffrey However, when I apply it to this Unicode string, I get only the
Jeffrey first 3 letters of the surname:
Jeffrey name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k'
Maybe
name = unicode('Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k', utf-8)
? Yup, that works:
name =
Jeffrey Barish wrote:
I have a regular expression that I use to extract the surname:
surname = r'(?u).+ (\w+)'
However, when I apply it to this Unicode string, I get only the first 3
letters of the surname:
name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k'
That's a byte string. You can
Hello folks ,
I trying to match a pattern in a string , i am new in using re .This is what
is happening
When i do this
p = re.compile('(\[NHX:)')
m = p.match([NHX:C=0.195.0])
print m
_sre.SRE_Match object at 0x013FE1E0
--- thus i am able to find the match
but when i use the string
m =
2008/10/2 aditya shukla [EMAIL PROTECTED]
Hello folks ,
I trying to match a pattern in a string , i am new in using re .This is
what is happening
When i do this
p = re.compile('(\[NHX:)')
m = p.match([NHX:C=0.195.0])
print m
_sre.SRE_Match object at 0x013FE1E0
--- thus i am able to
Matthew Barnett [EMAIL PROTECTED] added the comment:
I'll have a look at this. No promises, though.
--
nosy: +mrabarnett
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue694374
___
I have a file in which I am searching for the letter i (actually
a bit more general than that, arbitrary regular expressions could
occur) as long as it does not occur inside an expression that matches
\\.+?\b (something started by a backslash and including the word that
follows).
More concrete
On Thu, Aug 28, 2008 at 5:04 PM, Bart Kastermans
[EMAIL PROTECTED] wrote:
I have a file in which I am searching for the letter i (actually
a bit more general than that, arbitrary regular expressions could
occur) as long as it does not occur inside an expression that matches
\\.+?\b (something
On Aug 28, 4:04 pm, Guilherme Polo [EMAIL PROTECTED] wrote:
On Thu, Aug 28, 2008 at 5:04 PM, Bart Kastermans
[EMAIL PROTECTED] wrote:
I have a file in which I am searching for the letter i (actually
a bit more general than that, arbitrary regular expressions could
occur) as long
Bart Kastermans wrote:
I have a file in which I am searching for the letter i (actually
a bit more general than that, arbitrary regular expressions could
occur) as long as it does not occur inside an expression that matches
\\.+?\b (something started by a backslash and including the word
Hey All,
I have been playing around with REs and could not get the following
code to run.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
anything wrong I have done?
Regards,
Atul.
--
http://mail.python.org/mailman/listinfo/python-list
Atul. wrote:
I have been playing around with REs and could not get the following
code to run.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
anything wrong I have done?
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel,
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as expected here.
Peter
When I key this input in IDLE it works but when I try to run the
module it wont work.
--
Use the print statement:
import re
vowel = r'[aeiou]'
print re.findall(vowel, rvowel)
Alexey
On Fri, Aug 8, 2008 at 2:17 PM, Atul. [EMAIL PROTECTED] wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
Atul. wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as expected here.
Peter
When I key this input in IDLE it works but when I try to run the
module it wont work.
What's the name of your
On Aug 8, 4:22 pm, Peter Otten [EMAIL PROTECTED] wrote:
Atul. wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as expected here.
Peter
When I key this input in IDLE it works but when I
On Aug 8, 4:33 pm, Atul. [EMAIL PROTECTED] wrote:
On Aug 8, 4:22 pm, Peter Otten [EMAIL PROTECTED] wrote:
Atul. wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as expected here.
Atul. schrieb:
On Aug 8, 4:33 pm, Atul. [EMAIL PROTECTED] wrote:
On Aug 8, 4:22 pm, Peter Otten [EMAIL PROTECTED] wrote:
Atul. wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as expected here.
Peter
Atul. wrote:
On Aug 8, 4:33 pm, Atul. [EMAIL PROTECTED] wrote:
On Aug 8, 4:22 pm, Peter Otten [EMAIL PROTECTED] wrote:
Atul. wrote:
Yes. You didn't paste the traceback into your message.
import re
vowel = r'[aeiou]'
re.findall(vowel, rvowel)
['o', 'e']
It works as
The same file when I use with the following does not work.
import re
vowel =
r'[u\u093eu\u093fu\u0940u\u0941u\u0942u\u0943u\u0944u\u0945u\u0946u\u0947u\u0948u\u0949u\u094au\u094bu\u094c]'
print re.findall(vowel, u\u092f\u093e\u0902\u091a\u094d\u092f\u093e,
re.UNICODE)
[EMAIL
Atul. wrote:
The same file when I use with the following does not work.
import re
vowel =
r'[u\u093eu\u093fu\u0940u\u0941u\u0942u\u0943u\u0944u\u0945u\u0946u\u0947u\u0948u\u0949u\u094au\u094bu\u094c]'
print re.findall(vowel, u\u092f\u093e\u0902\u091a\u094d\u092f\u093e,
re.UNICODE)
Atul. [EMAIL PROTECTED] writes:
the following does not work.
import re
vowel =
r'[u\u093eu\u093fu\u0940u\u0941u\u0942u\u0943u\u0944u\u0945u\u0946u\u0947u\u0948u\u0949u\u094au\u094bu\u094c]'
Unfortunately you cannot embed arbitrary Python string constants
(u...) in regular expressions. What
On Jul 31, 10:07 pm, [EMAIL PROTECTED] wrote:
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string into different
sentences but split('.') doesn't solve the whole
On Aug 1, 12:53 pm, dusans [EMAIL PROTECTED] wrote:
On Jul 31, 10:07 pm, [EMAIL PROTECTED] wrote:
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string into different
sentences but split('.') doesn't solve the whole problem because of
possible periods in the middle
On Jul 31, 3:07 pm, [EMAIL PROTECTED] wrote:
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string into different
sentences but split('.') doesn't solve the whole
On Jul 31, 3:56 pm, Mensanator [EMAIL PROTECTED] wrote:
On Jul 31, 3:07 pm, [EMAIL PROTECTED] wrote:
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string
On Jul 31, 3:07 pm, [EMAIL PROTECTED] wrote:
middle_abbr = re.compile('[A-Za-z0-9]\.[A-Za-z0-9]\.')
When defining re's with string literals, it is good practice to use
the raw string literal format (precede with an 'r'):
middle_abbr = re.compile(r'[A-Za-z0-9]\.[A-Za-z0-9]\.')
What
On Jul 31, 9:07 pm, [EMAIL PROTECTED] wrote:
I am using regular expressions to search a string (always full
sentences, maybe more than one sentence) for common abbreviations and
remove the periods. I need to break the string into different
sentences but split('.') doesn't solve the whole
I'm trying to delimit sentences in a block of text by defining the
end-of-sentence marker as a period followed by a space followed by an
uppercase letter or end-of-string.
I'd imagine the regex for that would look something like:
[^(?:[A-Z]|$)]\.\s+(?=[A-Z]|$)
However, Python keeps giving me an
On Jul 14, 12:05 am, Chris [EMAIL PROTECTED] wrote:
I'm trying to delimit sentences in a block of text by defining the
end-of-sentence marker as a period followed by a space followed by an
uppercase letter or end-of-string.
I'd imagine the regex for that would look something like:
On Jul 13, 8:14 pm, MRAB [EMAIL PROTECTED] wrote:
On Jul 14, 12:05 am, Chris [EMAIL PROTECTED] wrote: I'm trying to delimit
sentences in a block of text by defining the
end-of-sentence marker as a period followed by a space followed by an
uppercase letter or end-of-string.
I'd imagine
On Jul 14, 9:05 am, Chris [EMAIL PROTECTED] wrote:
Misleading subject.
[] brackets or square brackets
{} braces or curly brackets
() parentheses or round brackets
I'm trying to delimit sentences in a block of text by defining the
end-of-sentence marker as a period followed by a space
John Machin wrote:
Uh-huh ... try this, then:
http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/
You could use this to find the Str cases and the prefixes of the
re cases (which seem to be no more complicated than 'foo.*bar.*zot')
and use something slower like Python's re to search the
expressions into a single DFA. Once that's done, the input can be
processed in a time proportional to the number of characters to be
scanned, and independent of the number or complexity of the regular
expressions. Python's existing regular expression matchers do not have
this property
Marc 'BlackJack' Rintsch [EMAIL PROTECTED]:
On Mon, 07 Jul 2008 16:44:22 +0200, Sebastian \lunar\ Wiesner wrote:
Mark Wooding [EMAIL PROTECTED]:
Sebastian lunar Wiesner [EMAIL PROTECTED] wrote:
# perl -e '(a x 10) =~ /^(ab?)*$/;'
zsh: segmentation fault perl -e '(a x 10) =~
401 - 500 of 992 matches
Mail list logo