Regular Expressions: Interrogation Mark

Problem:

Match the following expressions "1 file found?", "2 files found?" and "x files found?" using the interrogation mark.

Output:







Solution:


You could be doing this: 1?2?x? files? found\?

Or

This: \w files? found\?

\w indicates that it could be any character, I assume.


Alternatively, you can use: . files? found\?


No comments :

Post a Comment

Follow Me

If you like our content, feel free to follow me to stay updated.

Subscribe

Enter your email address:

We hate spam as much as you do.

Upload Material

Got an exam, project, tutorial video, exercise, solutions, unsolved problem, question, solution manual? We are open to any coding material. Why not upload?

Upload

Copyright © 2012 - 2014 Java Problems  --  About  --  Attribution  --  Privacy Policy  --  Terms of Use  --  Contact