S
S
Sorax152018-02-07 14:35:37
Regular Expressions
Sorax15, 2018-02-07 14:35:37

Regular expressions?

How to write a regular expression that would be numbers from 1 to 12, please help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kim, 2018-02-07
@kimono

preg_match('/([1-9]|1[0-2])/', $string)

S
Stimulate, 2018-02-07
@Stimulate

Comparing numbers is better not with regular expressions, but with mathematical operations

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question