[SLL] Scripting Question

Steve McCarthy sjm at mccrew.com
Wed Oct 3 16:31:23 PDT 2007


1.   /^string(\.\d)?/




On 10/3/07, Eric <eric at kahklen.com> wrote:
>
> I am biting the bullet and trying to learn more about shell and perl
> scripting.  I have two unrelated questions.
>
> 1.  Using perl regular expression, how could I match a string followed
> by a period and a digit? The string doesn't have to include the period
> and digit though. For example, I'd want to match something like this:
>
> string
> string.2
>
> but not:
>
> strings
> string9
> string.
> strings.2
>
> So far I've come up with
> /^string\.?[0-9]?/
>
>
-- 
Steve McCarthy
    sjm at mccrew.com
    mccrew at gmail.com


More information about the linux-list mailing list