What does .* do in regex?

前端 未结 3 1523
余生分开走
余生分开走 2021-02-10 06:52

After extensive search, I am unable to find an explanation for the need to use .* in regex. For example, MSDN suggests a password regex of

@\\\"(?=.{6,})(?=(.*\\         


        
3条回答
  •  被撕碎了的回忆
    2021-02-10 07:38

    The .* portion just allows for literally any combination of characters to be entered. It's essentially allowing for the user to add any level of extra information to the password on top of the data you are requiring

    Note: I don't think that MSDN page is actually suggesting that as a password validator. It is just providing an example of a possible one.

提交回复
热议问题