Le Mon, 23 Feb 2009 06:45:23 -0500,
Kent Johnson s'exprima ainsi:
> On Sun, Feb 22, 2009 at 10:49 PM, ish_ling wrote:
> > I have a string:
> >
> >'a b c h'
> >
> > I would like a regex to recursively match all alpha letters that are
> > between . That is, I would like the following list of
>
On Sun, Feb 22, 2009 at 10:49 PM, ish_ling wrote:
> I have a string:
>
>'a b c h'
>
> I would like a regex to recursively match all alpha letters that are between
> . That is, I would like the following list of matches:
>
>['d', 'e', 'f', 'i', 'j']
>
> I do not want the 'g' or the 'k' mat
I second Alan G's appreciation for a well-thought-through and well-conveyed
description of your text processing task. (Is "Alan G" his gangsta name, I
wonder?)
This pyparsing snippet may point you to some easier-to-follow code,
especially once you go beyond the immediate task and do more exhausti
"ish_ling" wrote
'a b c h'
I would like a regex to
Congratulations on a cclear explanation of what you want.
With regex questions that is half the battle.
I have figured out how to do this in a multiple-step process
And there's nothing much wrong with multi step.
with re.findall()
I have a string:
'a b c h'
I would like a regex to recursively match all alpha letters that are between . That is, I would like the following list of matches:
['d', 'e', 'f', 'i', 'j']
I do not want the 'g' or the 'k' matched.
I have figured out how to do this in a multiple-step proce
William O'Higgins Witteman wrote:
> On Mon, Aug 28, 2006 at 11:36:18AM -0400, Kent Johnson wrote:
>
>> William O'Higgins Witteman wrote:
>>
>>> Thank you for this. The problem is apparently not my syntax, but
>>> something else. Here is a pared-down snippet of what I'm doing:
>>>
>>> In [1
On Mon, Aug 28, 2006 at 11:36:18AM -0400, Kent Johnson wrote:
>William O'Higgins Witteman wrote:
>> Thank you for this. The problem is apparently not my syntax, but
>> something else. Here is a pared-down snippet of what I'm doing:
>>
>> In [1]: import re
>>
>> In [2]: pat = re.compile('''
>>
William O'Higgins Witteman wrote:
> Thank you for this. The problem is apparently not my syntax, but
> something else. Here is a pared-down snippet of what I'm doing:
>
> In [1]: import re
>
> In [2]: pat = re.compile('''
> ...:copy of
> ...:|
> ...:admin
> ...
On Sat, Aug 26, 2006 at 09:45:04AM -0400, Kent Johnson wrote:
>William O'Higgins Witteman wrote:
>> I want a case-insensitive, verbose pattern. I have a long-ish list of
>> match criteria (about a dozen distinct cases), which should be all "or",
>> so I won't need to be clever with precedence.
>
>
On 8/26/06, William O'Higgins Witteman <[EMAIL PROTECTED]> wrote:
> I want a case-insensitive, verbose pattern. I have a long-ish list of
> match criteria (about a dozen distinct cases), which should be all "or",
> so I won't need to be clever with precedence.
BTW I find it easier not to use re.
William O'Higgins Witteman wrote:
> Hello all,
>
> I've been looking for an example of the regex I need, and so far, I
> haven't found anything. Here's what I need:
>
> I want a case-insensitive, verbose pattern. I have a long-ish list of
> match criteria (about a dozen distinct cases), which sho
Hello all,
I've been looking for an example of the regex I need, and so far, I
haven't found anything. Here's what I need:
I want a case-insensitive, verbose pattern. I have a long-ish list of
match criteria (about a dozen distinct cases), which should be all "or",
so I won't need to be clever
> On Mon, 10 Oct 2005, Bill Burns wrote:
>
>
>>I'm looking to get the size (width, length) of a PDF file.
>
> Hi Bill,
>
> Just as a side note: you may want to look into using the 'pdfinfo' utility
> that comes as part of the xpdf package:
>
> http://www.foolabs.com/xpdf/
>
> For exampl
On Mon, 10 Oct 2005, Bill Burns wrote:
> I'm looking to get the size (width, length) of a PDF file.
Hi Bill,
Just as a side note: you may want to look into using the 'pdfinfo' utility
that comes as part of the xpdf package:
http://www.foolabs.com/xpdf/
For example:
[Andrew]
> If the format is consistent enough, you might get away with something like:
>
> >>> p = re.compile('MediaBox \[ ?\d+ \d+ (\d+) (\d+) ?\]')
> >>> print p.search(s).groups()
> ('612', '792')
>
> The important bits being: ? means "0 or 1 occurences", and you can use
> parentheses to
>> I'm looking to get the size (width, length) of a PDF file. Every pdf
>> file has a 'tag' (in the file) that looks similar to this
>>
>> Example #1
>> MediaBox [0 0 612 792]
>>
>> or this
>>
>> Example #2
>> MediaBox [ 0 0 612 792 ]
>>
>> I figured a regex might be a good way to get this data but
If the format is consistent enough, you might get away with something like:
>>> p = re.compile('MediaBox \[ ?\d+ \d+ (\d+) (\d+) ?\]')
>>> print p.search(s).groups()
('612', '792')
The important bits being: ? means "0 or 1 occurences", and you
can use parentheses to group matches, and they get
At 09:10 PM 10/9/2005, Bill Burns wrote:
>I'm looking to get the size (width, length) of a PDF file. Every pdf
>file has a 'tag' (in the file) that looks similar to this
>
>Example #1
>MediaBox [0 0 612 792]
>
>or this
>
>Example #2
>MediaBox [ 0 0 612 792 ]
>
>I figured a regex might be a good way
I'm looking to get the size (width, length) of a PDF file. Every pdf
file has a 'tag' (in the file) that looks similar to this
Example #1
MediaBox [0 0 612 792]
or this
Example #2
MediaBox [ 0 0 612 792 ]
I figured a regex might be a good way to get this data but the
whitespace (or no whitespac
19 matches
Mail list logo