user3333311
user3333311

Reputation: 21

PHP regex format?

I am trying to write a regex format to check the following type string:

40/4

The following features I need:

Here's what I ended up writing:

"/^.{4}$[1-9][0-9][\/][1-9]/"

Please help me to write the correct format.

Thanks

Upvotes: 2

Views: 57

Answers (1)

xdazz
xdazz

Reputation: 160863

It will be like below:

/^[1-9][0-9]\/[0-9]$/

Upvotes: 3

Related Questions