Wrox Programmer Forums
|
BOOK: Beginning Regular Expressions
This is the forum to discuss the Wrox book Beginning Regular Expressions by Andrew Watt; ISBN: 9780764574894
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Regular Expressions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2006, 03:42 PM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default last directory pattern

i want all directoris of this format :

 .* then followed by "plugin" then .* (this .* doesnot contain any slash)

 for ex, this shd match /home/plugin_5.6
 but this shd not match /homt/plugin/package

can some body give me regular expression for this ? thnx in advance

 
Old September 8th, 2006, 12:45 AM
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

 I'm master of Perl regex.
print "1 Matched\n" if '/home/plugin_5.6' =~ /.*?plugin[^\/]*$/;
print "2 Matched\n" if '/homt/plugin/package' =~ /.*?plugin[^\/]*$/;

Regards,
 Serge
http://www.gameintellect.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax Pattern TheGame Ajax 1 July 26th, 2008 03:02 PM
Dispose Pattern guntank C# 0 September 26th, 2006 10:08 PM
Javascript Pattern How To muklee Javascript How-To 3 September 15th, 2006 09:11 AM
Desing Pattern tilakkalyan J2EE 3 February 14th, 2006 07:04 AM
DirectoryInfo.GetFiles(pattern): search pattern fo arif_1947 VS.NET 2002/2003 1 October 19th, 2004 11:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.