• Register
0 votes


I am new, I need help, can anyone help?
Using wildcard metacharacters, how can one indicate a number is either 1, 2, 3, or 4?
a. 1-4
c. [1234]
b. [1-4]
d. [1,2,3,4]
7 5 3
5,380 points

Please log in or register to answer this question.

1 Answer

0 votes


The correct answer is [1-4]
Using the current "regular expressions" in use in java, perl, and many other applications, this belongs to "character class" using the [ ] notation.
for characters "either" 1,2,3,4, we write
or in this particular case,
This might help you.
8 5 2
10,530 points

Related questions

0 votes
2 answers 655 views
Problem: A ________ value in a loop can be either a positive or a negative number. Is this true of False? I am bit confused can anyone suggest?
asked Sep 29, 2019 anonymous
0 votes
1 answer 25 views
Problem: I am little bit confused, which statement is true? You can use wildcard metacharacters with the find command? True False
asked Feb 21, 2020 maddi86 5.4k points
0 votes
1 answer 6 views
Problem: I am trying to set up .NET 4.6 and also take advantage of the latest C # by changing the C # language version to 6. However, during compilation, I got this error: Error Invalid option "6" for / langversion; should be ISO-1, ISO-2, 3, ... manually if it was not installed by default by Visual Studio 2015. The project is a standard ASP.NET MVC template project created by Visual Studio 2015.
asked Jan 24 sasha 8.4k points
0 votes
1 answer 3 views
Problem : Why is it wrong to interpret 4 + 20 / (3 - 1) * 2 as 4 + (20) / ((3 - 1) * 2)?
asked 4 days ago Shovo210 2.2k points
0 votes
1 answer 9 views
Problem: Write a shell script to print numbers as 5 4 3 2 1 using while loop.
asked Feb 13 Shovo210 2.2k points
0 votes
1 answer 6 views
Problem: I am using MySQL with Spring JDBC template for my web application. I need to store phone number with only digits (10). I am little bit confused about data type using data type. What is preferable data type for it in MySQL? What should be Java ... in Bean (POJO) classes for that? How can I validate that datatype with javax validations/constrains for length and also only digit allowed?
asked 3 days ago Ali 4.4k points
0 votes
2 answers 24 views
1 vote
1 answer 50 views
Problem: I wrote a program in python to check if a given number is sparse or not. So I wrote this code: def IsSparse(n): if ((n<<1) & (n>>1)): return 0 return 1 print(IsSparse(35)) print(IsSparse(16)) print(IsSparse(12)) print(IsSparse(72)) And when I run this or ... . The output is: 1 1 1 1 But the actual output should be: 0 1 0 1 What should I do to get the actual result? Thanks in advance.
asked Apr 22, 2020 samhaz 5k points
0 votes
1 answer 1 view
1 view
Problem: I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file I was wondering if there is a smarter way to do that
asked 1 day ago Ali 4.4k points
0 votes
1 answer 3 views
Problem: lines() - read all lines of the file as a stream count() - returns the number of elements in the stream Here, if the file input.txt contains the following content: This is the question on Java Examples. The examples count number of lines in a file. , youhave used the java.nio.file package.
asked 4 days ago Ali 4.4k points