Questions tagged [wildcard]

A wildcard character is a specially defined character allowing for substitution of any other character, including a pattern or sequence of characters. Use this tag for questions on how to use wildcards for regular expressions, shell scripting, string manipulation and database control, but not for use in terminal commands as that is off-topic.

A wildcard character is a special character defined by many different systems/programming languages with each their own specific implementations. They may allow for accessing single characters, sets of characters or all characters matching a certain regex pattern.

Examples include :

* - Any sequence of characters. (DOS/Unix)
? - Any single character. (DOS/Unix)
% - Zero or more characters. (SQL)
# - Matches a single numeral. (SQL)
. - Matches a single character. (Regular Expressions)

4611 questions
816
votes
4 answers

wildcard * in CSS for classes

I have these divs that I'm styling with .tocolor, but I also need the unique identifier 1,2,3,4 etc. so I'm adding that it as another class tocolor-1.
tocolor 1
tocolor 2 …
twitter
  • 8,895
  • 6
  • 22
  • 20
572
votes
18 answers

Why is using a wild card with a Java import statement bad?

It is much more convenient and cleaner to use a single statement like import java.awt.*; than to import a bunch of individual classes import java.awt.Panel; import java.awt.Graphics; import java.awt.Canvas; ... What is wrong with using a wildcard…
jnancheta
  • 7,008
  • 8
  • 25
  • 18
459
votes
33 answers

Select all columns except one in MySQL?

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
Tom Grochowicz
  • 5,385
  • 3
  • 21
  • 18
423
votes
14 answers

Get a filtered list of files in a directory

I am trying to get a list of files in a directory using Python, but I do not want a list of ALL the files. What I essentially want is the ability to do something like the following but using Python and not executing ls. ls 145592*.jpg If there is…
mhost
  • 6,930
  • 5
  • 38
  • 45
391
votes
21 answers

Check if a file exists with a wildcard in a shell script

I'm trying to check if a file exists, but with a wildcard. Here is my example: if [ -f "xorg-x11-fonts*" ]; then printf "BLAH" fi I have also tried it without the double quotes.
Danny
  • 5,180
  • 6
  • 26
  • 29
291
votes
17 answers

Unzip All Files In A Directory

I have a directory of ZIP files (created on a Windows machine). I can manually unzip them using unzip filename, but how can I unzip all the ZIP files in the current folder via the shell? Using Ubuntu Linux Server.
Lennie De Villiers
  • 5,119
  • 7
  • 31
  • 30
187
votes
17 answers

How to find files that match a wildcard string in Java?

This should be really simple. If I have a String like this: ../Test?/sample*.txt then what is a generally-accepted way to get a list of files that match this pattern? (e.g. it should match ../Test1/sample22b.txt and ../Test4/sample-spiffy.txt but…
Jason S
  • 184,598
  • 164
  • 608
  • 970
169
votes
4 answers

What does the double-asterisk (**) wildcard mean?

I've tried the following command but I don't understand the results: ls ** What does ** mean? How should I use it?
Mike Blair
  • 1,821
  • 2
  • 11
  • 11
160
votes
9 answers

When to use generic methods and when to use wild-card?

I am reading about generic methods from OracleDocGenericMethod. I am pretty confused about the comparison when it says when to use wild-card and when to use generic methods. Quoting from the document. interface Collection { public boolean…
benz
  • 4,561
  • 7
  • 37
  • 68
160
votes
4 answers

Find all elements on a page whose element ID contains a certain text using jQuery

I'm trying to find all elements on a page whose element ID contains a certain text. I'll then need to filter the found elements based on whether they are hidden or not. Any help is greatly appreciated.
user48408
  • 3,234
  • 11
  • 39
  • 59
120
votes
5 answers

How to put wildcard entry into /etc/hosts?

I recently wanted to point all subdomains for a test domain, let's say example.com to the localhost. Is there a way to point all requests on *.example.com to resolve to 127.0.0.1
aamir
  • 3,753
  • 4
  • 23
  • 34
120
votes
4 answers

Stop shell wildcard character expansion?

Is there any way for a compiled command-line program to tell bash or csh that it does not want any wildcard characters in its parameters expanded? For instance, one might want a shell command like: foo * to simply return the numeric ASCII value of…
hotpaw2
  • 70,107
  • 14
  • 90
  • 153
114
votes
2 answers

Why does "_" (underscore) match "-" (hyphen)?

I have to look for a PDF manual using this query: root@localhost:test> select * from a where name like '%taz_manual%.pdf%'; +--------------------+------------------+-------------+ | name | description | size |…
E.G.
  • 2,848
  • 3
  • 20
  • 23
110
votes
4 answers

How to use a wildcard in the classpath to add multiple jars?

I have been using so many 3rd party libraries(jar files) that my CLASSPATH is completely messed up as i have to include the path for every single jar file that i use. I've been wondering if there is a way to include all the jar files in a folder…
paulbullard
  • 1,187
  • 2
  • 8
  • 9
104
votes
5 answers

Adding new value to existing Stream

Is there is a good way to add a new value to existing Stream? All I can imagine is something like this: public Stream addToStream(Stream stream, T elem ) { List result = stream.collect(Collectors.toList()); result.add(elem); …
Dmytro
  • 1,850
  • 3
  • 14
  • 20
1
2 3
99 100