- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does [Ss]* mean in regex in PHP?
The regular expression [\S\s]* in PHP means “don’t match new lines”.
In PHP, the /s flag can be used to make the dot match all the characters −
Example
print(preg_match('/^[\S\s]$/s',"hello
world"));
Output
This will produce the following output −
0
The ‘preg_match’ function is used to match regular expression with the given input string. Here since the ‘\’ is encountered, it returns 0.
Advertisements