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
21
votes
5 answers

Java lower bound wildcards

I'm struggling to get my head around this and was wondering if someone could explain the reasons for this. I have three classes: class Angel {} class Person extends Angel {} class Employee extends Person {} When I attempt to execute this…
Mike
  • 2,391
  • 6
  • 33
  • 72
20
votes
8 answers

Wildcard Subdomains

I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far... With that in mind, here is what I'm trying to do: First, I want to allow users to…
beaudeal
  • 203
  • 1
  • 3
  • 7
20
votes
2 answers

How to use jq wildcard

I have the following json: { "details":{ "car": "bmw", "addresses":{ "ext-118-21-8-0-29":[ { "version":4, "addr":"89 Psr" }, { …
executable
  • 3,365
  • 6
  • 24
  • 52
20
votes
4 answers

Is there a wildcard expansion option for .net apps?

I've used the setargv.obj linking for Expanding Wildcard Arguments in the past for a number of C and C++ apps, but I can't find any similar mention for .net applications. Is there a standard way to have your app's command line parameters…
crashmstr
  • 28,043
  • 9
  • 61
  • 79
20
votes
4 answers

react router, match wildcard as parameter

I have a legacy web app that is being replaced with React and it is called by these various systems by being passed a URL (derived from records in and existing DB system) The app renders folder views, of files in a sandboxed container according to…
Code Uniquely
  • 6,356
  • 4
  • 30
  • 40
19
votes
8 answers

MySQL Wildcard for "=" - is there one

So, SELECT * FROM table WHERE col LIKE '%' will return everything. Is there a wildcard for the query SELECT * FROM table WHERE col = '*' Clearly * doesn't work, I just put it there to indicate where I'd like a wildcard. The column I'm selecting…
Dan
  • 916
  • 2
  • 7
  • 10
19
votes
3 answers

How to implement glob in C#

I don't know if it's legit at StackOverflow to post your own answer to a question, but I saw nobody had asked this already. I went looking for a C# Glob and didn't find one, so I wrote one that others might find useful.
Mark Maxham
  • 1,501
  • 2
  • 13
  • 19
19
votes
1 answer

Wildcard in Hadoop's FileSystem listing API calls

tl;dr: To be able to use wildcards (globs) in the listed paths, one simply has to use globStatus(...) instead of listStatus(...). Context Files on my HDFS cluster are organized in partitions, with the date being the "root" partition. A simplified…
snooze92
  • 4,178
  • 2
  • 29
  • 38
18
votes
2 answers

Get-ChildItem Doesn't Work With Include

Example I am following: Get-ChildItem c:\scripts\*.* -include *.txt,*.log https://technet.microsoft.com/en-us/library/ee176841.aspx What gives? Why don't I get back a list of my test.txt files when I try to use include? As a side note, what is…
VSO
  • 11,546
  • 25
  • 99
  • 187
18
votes
6 answers

The issue of * in Command line argument

I wrote a program in Java that accepts input via command line arguments. I get an input of two numbers and an operator from the command line. To multiply two numbers, I have to give input as e.g. 5 3 *, but it's not working as written. Why is it not…
Nithismiles
  • 189
  • 1
  • 1
  • 4
18
votes
3 answers

C# generics - without lower bounds by design?

I was reading an interview with Joshua Bloch in Coders at Work, where he lamented the introduction of generics in Java 5. He doesn't like the specific implementation largely because the variance support—Java's wildcards—makes it unnecessarily…
ehnmark
  • 2,656
  • 3
  • 24
  • 20
18
votes
5 answers

Problem using generic map with wildcard

I have a method that returns a map defined as: public Map getData(); The actual implementation of this method is not clear to me, but, when I try to do: obj.getData().put("key","value") I get following compile time error message: The…
mmoossen
  • 1,237
  • 3
  • 21
  • 32
18
votes
4 answers

Can I use wildcards in "IN" MySQL statement?

I would like to run something like: select * from table where field in ("%apple%", "%orange%") Is there a way? Or at least is there a better way than dynamically building query for every keyword: select * from table where field like "%apple%" or…
serg
  • 109,619
  • 77
  • 317
  • 330
18
votes
2 answers

Wildcard of Number in SQL Server

How to match numbers in SQL Server 'LIKE'. SpaceName ------------ | New_Space_1 | . | . | New_Space_8 | New_Space_9 | New_Space_10 | New_Space_11 | New_Space_SomeString | New_Space_SomeString1 Above is my table contents. I want to get only…
Sreekumar P
  • 5,900
  • 11
  • 57
  • 82
17
votes
2 answers

How to ignore characters on a MYSQL SELECT LIKE %...%

I have a table with a phone column, where data may have spaces, dots,dashes or + signs between the numbers. I need to do a search with LIKE wildcards that ignore all those characters, for example: a record may have phone as "+123-456 78.90" a query…
Henry
  • 1,374
  • 2
  • 14
  • 24