PHP Regex Any Character

后端 未结 5 642
醉梦人生
醉梦人生 2020-12-10 01:10

The . character in a php regex accepts all characters, except a newline. What can I use to accept ALL characters, including newlines?

5条回答
  •  抹茶落季
    2020-12-10 01:31

    It's the the . character that means "every character" (edit: OP edited). And you need to add the option s to your regexp, for example :

    preg_match("`(.+)`s", "\n");
    

提交回复
热议问题