Regular expression to validate Excel cell

前端 未结 2 1706
臣服心动
臣服心动 2021-01-24 20:05

I\'m working on a php application where the user has to insert an Excel\'s cell id (for example A1 or AB32), a value which is stored in the database fo

2条回答
  •  逝去的感伤
    2021-01-24 20:35

    try this ^[a-zA-Z]{1,4}(\d+)$

    • ^([a-zA-Z]+) : starting between 1 and 4 letters
    • (\d+)$ : ending with one digit or more

提交回复
热议问题