Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!inesc!unl!unl!jpc From: jpc@fct.unl.pt (Jose Pina Coelho) Newsgroups: comp.sys.amiga.introduction Subject: Re: Wildcards in the CLI Message-ID: Date: 8 May 91 16:47:38 GMT References: <1991Apr16.155231.18782@ux1.cso.uiuc.edu> <7384@munnari.oz.au> <6512@bwdls58.bnr.ca> <20893@cbmvax.commodore.com> <1991Apr25.100919.21595@fwi.uva.nl> <21179@cbmvax.commodore.com> Sender: news@fct.unl.pt (USENET News System) Organization: Universidade Nova de Lisboa -- Lisbon, Portugal Lines: 97 In-Reply-To: sutela@polaris.utu.fi's message of 7 May 91 06:42:09 GMT In article sutela@polaris.utu.fi (Kari Sutela) writes: jpc@fct.unl.pt (Jose Pina Coelho) writes: >In article <21179@cbmvax.commodore.com> daveh@cbmvax.commodore.com >(Dave Haynie) writes: >> >> And pattern matching is now a dos.library function call, which means that >> all programmers have access to this, anywhere they want it. > - Oh God!!! Let it be UNIX-like wild cards (or full regexps). > I don't understand why people consider the stupid star to be so important. > Anyway, there's a small PD-utility (StartBurst) which enables the DOS-flag > which makes * to be equal to #?. Because, it has been used with that semantics for too long, half of the people that use command line, be it MSDOS, Unix, Vms etc ... are almost hard-wired to recognize * as zero or more characters. > To my knowledge the regexps supported in release 2 of system software are: > ? matches any character > # matches an indefinite (0 or more) number of the following > pattern > | matches either the pattern on the left or the right side > () used for grouping the patterns > ' used to escape the following character > % a null pattern > ~ (tilde) matches anything but the following pattern > [c-x] matches a character range. BTW, I didn't notice any > documentation on this feature in my System Software > manual --- anyone got a description of this? It seems > that one can also specify character sets like [cef]. So, they want something that is more regexp alike ?, why create something that resembles the true regexp, and yet paint it as something diferent ? RegExp's as they have been for the past 15 years: . - Match any character * - Zero or more times the previous pattern. + - One or more times the previous pattern. ? - Zero or one time the previous pattern. () - Group pattern | - Either the pattern on the left or the right side ^ - Start of string $ - end of string [chars] - Match chars. [^chars] - Match anything but chars. - If you have char1-char2, that means anything between char1 and char2. - To match a '-' use it as the first character. \ - escape the following character. {n,m} - n or m times the previous pattern. (Not sure if it's standard) > As you can see, the 2.0 regexps are quite powerful. They are not the same > as the Unix ones, but what's wrong with that. AmigaDos is not Unix. As we can see, the oldtime, unix regexps are more powerfull, and have the following advantages: - It's already done. - Lot's of public-domain/freeware/otherwares implementations, so C= could have just taken one and put it in the ROM (ort the shell, or the programs, or a library). They could even implement one (not that hard). - It's standard (Maybe a standard that never got to ANSI (or maybe it did), but anyway a standard. > >Copy files [to] [file/dir] > > ^^^^ why the f*** ? > > Because one could want to specify the parameters in a different order. For >