### Instructions to
solve php-Laravel preg_match(): No ending delimiter’/’ found
1. The reason for
the problem is normally added as follows
1
2
3
4
5
6
|
public function rules() { return [ 'domain' => 'required|regex:/^[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-]+\.[a-zA-Z]+$/' ]; } |
Then when I tested the interface, I found that it kept reporting errors:
php-Laravel preg_match(): No ending delimiter’/’ found
Second, the solution is to
change the code to this
public function rules() { return [ 'domain'=>['required','regex:/^[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-]+\.[a-zA- Z]+$/' ] ]; }
Then it’s normal
Similar Posts:
- PHP regular matching H1 datagram error preg_ match(): Unknown modifier ‘h’ in
- What happened to CodeIgniter disallowed key characters?
- The URI you submitted has disallowed characters…
- [Solved] JpaRepository Error: Paging query needs to have a Pageable parameter! Offending method public abstract
- Laravel project login error: the MAC is invalid
- How to Use delimiter// to solve MySQL end error
- [Solved] iOS – NSURLConnection finished with error – code -1002
- [LeetCode] 291. Word Pattern II
- Error reporting of console.log in eslint
- [Solved] laravel -bash: laravel: command not found