J
J
jjproganet2020-02-18 00:43:32
Regular Expressions
jjproganet, 2020-02-18 00:43:32

How should you write the regular expression for height and what grade is the person in?

Misha is in the 3rd grade, his height is 150 cm.

You need to write down a regular expression. My attempts were successful with '[0-9]+cm'.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2020-02-18
@sergiks

One or more digits (remember)
Space
"class"
Many non-digits
One or more digits (remember)
Space
"cm"

A
Andrey, 2020-02-18
@anerev

\b\d{2,3} cm\b
\b\d{,2} class\b

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question