Re: A little regex help please ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2006-07-10 at 07:49 -0700, Brian D. McGrew wrote:
> Regex has always been a mystery to me, any help would be great!

As someone else pointed out, you're doing 'globbing', or pathname
expansion.  If you do want to learn and debug POSIX style regular
expressions, I highly recommend regex-coach.  You can type in a regex,
and some text, and see what it matches.  Lots of features.

See:
http://weitz.de/regex-coach/

p.s. If I've understood what you want, my solution would be:

#!/bin/bash
shopt -s extglob
for file in *[0-9].*[0-9].*[0-9] ; do
	# stuff
done

this will iterate over all files/directories of the form
number.number.number and ignore everything else.

Matt
Matt Davey		Make it as simple as possible, but no simpler.
mcdavey@xxxxxxxxxxxxxx 			     Einstein.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux