Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] What is the most appropriate scripting language
- Date: Thu, 18 Jan 2007 17:09:33 +0900
- From: "Zev Blut" <zb@example.com>
- Subject: Re: [tlug] What is the most appropriate scripting language
- References: <45AAFDA9.90504@example.com> <45AB4287.3070203@example.com> <3156339d0701152057u436f1122u82c2dbcd8aad9367@example.com> <87vej7cmw2.fsf@example.com> <3156339d0701161825y75fec769w6055610ba5878706@example.com>
- Organization: Ubiquitous Business Technology, Inc.
- User-agent: Opera Mail/9.02 (Linux)
On Wed, 17 Jan 2007 11:25:42 +0900, Ian MacLean <imaclean@example.com> wrote:
On 1/16/07, Stephen J. Turnbull <stephen@example.com> wrote:
on.
> The only thing I like better in perl is the more natural syntax for > regexes.
What are you referring to? The "target ~= regex" notation?
exactly :
import re p = re.compile('[a-z]+') if p.match("some text"): do_somthing()
in python vs :
if ( "some text" =~ /[a-z]+/ ) { do_somthing(); } in perl.
Ruby is like Perl or Python in this context. You can choose which you like.
Personally if I am going to use the matched data I do
if m = /\w\s(\w)+/.match("Some text") puts m[1] end
And if I just want to know if the line matches I do:
puts "Matches" if /\w\s\w+/ =~ "Some text"
Zev
- References:
- [tlug] What is the most appropriate scripting language
- From: Dave M G
- Re: [tlug] What is the most appropriate scripting language
- From: Walter Hansen
- Re: [tlug] What is the most appropriate scripting language
- From: Ian MacLean
- Re: [tlug] What is the most appropriate scripting language
- From: Stephen J. Turnbull
- Re: [tlug] What is the most appropriate scripting language
- From: Ian MacLean
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Tech meeting videos
- Next by Date: Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- Previous by thread: Re: [tlug] What is the most appropriate scripting language
- Next by thread: Bourne Shell is the most appropriate scripting language (was Re: [tlug] What is the most appropriate scripting language)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links