Regular Expressions: Capturating dimensions of a screen

Problem:

Using regular expressions, capture the dimensions of a video or a screen.

Output:






Solution:

Since we don't if the dimension will be three or four dimensions. Using the "+" sounds appropriate here.

So: \d+x\d+
Capturing what you need: (\d+)x(\d+)



1 comment :

  1. With a math calculator, even complicated formulas become easier to manage and understand.

    ReplyDelete

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