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+)

No comments:

Post a Comment