5

?* regular expression in sh

view full story
linux-howto

http://www.unix.com – Hi, what ?* means in sh script? I know that ? is equivalent to at least one appearance of a preceding expression and * is equivalent to at least one appearance of preceding expression but I have difficulties with a way in which I should interpret following pattern: -?* I would expect that it should match expressions like -, --, --- because I read it as follows: -? means that regexp should match at least one -. Then, if there are no minuses in the expression it doesn't match. But with at least one minus * will cause that expressions which have two or more minuses will match, too. But I h (HowTos)