How to write regular matching for such URL?

need to match:

https://www.example.com
https://www.example.com/demo
https://www.example.com/demo/abc
https://www.example.com/demo/abc/123.html ()

mismatch:

https://www.example.com/demo/abc/efg123.html 

Click to view the matching result

can also be written


/^https:\/\/www\.example\.com(\/[a-z]+(\/[a-z]+(\/\d+\.html)?)?)?$/

/^https:\/\/www\.example\.com(\/[a-z]+(\/[a-z]+(\/\d+\.html)?)?)?$/

can't match
@ yuanxiaowa

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b315c6-2b5dd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b315c6-2b5dd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?