[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: capturing sub-expressions?
From: |
Dan Stromberg |
Subject: |
Re: capturing sub-expressions? |
Date: |
Wed, 06 Feb 2008 02:33:17 GMT |
User-agent: |
Pan/0.132 (Waxed in Black) |
On Tue, 29 Jan 2008 18:27:05 -0800, Linda Walsh wrote:
> Paul Jarc wrote:
>> Linda Walsh <bash@tlinx.org> wrote:
>>> p="-e -p 60 -x"
>>> ---
>>> That's why I wanted the capture -- to pick out the 60 -- where 60
>>> represents a positive integer. The space between the -p and the
>>> number is optional.
>>
>> It sounds like you're looking for getopt.
> ---
> I knew about getopt -- was just wanting a string-manipulation
> mechanism to do it, but am maybe getting too used to string
> manipulations in perl? Would still love to use perl's full RE's in bash
> expressions, such is life... (am not sure I want it enough to try
> implementing/merging them...:-)) Linda
If it's regex's you need, sed can do them nicely (without needing to
leave the world of shell programming), and python has "perl compatible
regex's" - but then python will often have a better way than regex's to
do things. :)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: capturing sub-expressions?,
Dan Stromberg <=