Live data from Hacker News

Asterisk

cormullion.github.io

1–10 of 21 posts

Re: Asterisk

#3
"Perhaps this is where the use of * as the wild-card character comes from."

"." is the wildcard character. "*" is a quantifier meaning 0 or more of the previous.

Re: Asterisk

#4

"Perhaps this is where the use of * as the wild-card character comes from." "." is the wildcard character. "*" is a quantifier meaning 0 or more of the previous.

in regex this is correct, but in many other contexts * is used as wildcard.

ie.: in most OSes you can use * as wildcard for filename.

file.*

will refer to all files named "file" with any extension

.zip

will refer to all files with any name as long as they have the zip extension

is a wildcard in most contexts while "." is wildcard only in regex that i know.

Re: Asterisk

#6
post #4

"Perhaps this is where the use of * as the wild-card character comes from." "." is the wildcard character. "*" is a quantifier meaning 0 or more of the previous.

in regex this is correct, but in many other contexts * is used as wildcard. ie.: in most OSes you can use * as wildcard for filename. file.* will refer to all files named "file" with any extension .zip will refer to all files with any name as long as they have the zip extension is a wildcard in most contexts while "." is wildcard only in regex that i know.

True. But in the article, the full paragraph reads like this:

Perhaps this is where the use of * as the wild-card character comes from. I find regular expressions can induce swearing, occasionally.

Re: Asterisk

#7
post #6
post #4

Earlier quoted context omitted.

in regex this is correct, but in many other contexts * is used as wildcard. ie.: in most OSes you can use * as wildcard for filename. file.* will refer to all files named "file" with any extension .zip will refer to all files with any name as long as they have the zip extension is a wildcard in most contexts while "." is wildcard only in regex that i know.

True. But in the article, the full paragraph reads like this: Perhaps this is where the use of * as the wild-card character comes from. I find regular expressions can induce swearing, occasionally.

* is the wildcard in some forms of regular expressions, such as file name globs.

Re: Asterisk

#8
Coming from Russian books I was extremely confused by the varied asterisks used for footnotes in English/American literature. Why would you go to all the trouble with 15 different types of asterisks when you can just use numbers?

Re: Asterisk

#9
post #6

Earlier quoted context omitted.

True. But in the article, the full paragraph reads like this: Perhaps this is where the use of * as the wild-card character comes from. I find regular expressions can induce swearing, occasionally.

* is the wildcard in some forms of regular expressions, such as file name globs.

I know that * is the wildcard in many expressions, such as some query languages and (as you say) file name globs. However, I don't actually think a wildcard glob is a regular expression. Wikipedia, always a risky source :-), makes that point, with a reference to further reading.

The article is about the asterisk character, and the connection to the wild-card seems legit. But the sentence "I find regular expressions can induce swearing, occasionally" (which I agree fully with!) hints towards the idea that the * is used as a wildcard in regular expressions, which I think isn't quite true.

[1] https://en.wikipedia.org/wiki/Glob_(programming)#Compared_to...

Re: Asterisk

#10
post #6

Earlier quoted context omitted.

True. But in the article, the full paragraph reads like this: Perhaps this is where the use of * as the wild-card character comes from. I find regular expressions can induce swearing, occasionally.

* is the wildcard in some forms of regular expressions, such as file name globs.

A glob isn't a regular expression, and indeed one of the reasons it isn't is that it lacks the Kleene star - which is the thing an asterisk does in the typical regular expression syntax.
Post reply on HN