อยากทราบวิธีเขียน Pattern preg_match_all มันเขียนยังไง

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

อยากทราบวิธีเขียน Pattern preg_match_all มันเขียนยังไง

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

อยากทราบวิธีเขียน Pattern preg_match_all มันเขียนยังไง ตอนนี้ ต้องการเขียน ให้ค้นหาคำภาษาไทย ตัวเลข เเละ อักษรภาษาอังกฤษ บลาๆ เเต่ไม่รู้วิธีเขียน Pattern
ภาพประจำตัวสมาชิก
tsukasaz
PHP VIP Members
PHP VIP Members
โพสต์: 22101
ลงทะเบียนเมื่อ: 18/04/2012 9:39 am

Re: อยากทราบวิธีเขียน Pattern preg_match_all มันเขียนยังไง

โพสต์ที่ยังไม่ได้อ่าน โดย tsukasaz »

Simple regex

Regex quick reference
[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character
\S Any non-whitespace character
\d Any digit
\D Any non-digit
\w Any word character (letter, number, underscore)
\W Any non-word character
\b Any word boundary character
(...) Capture everything enclosed
(a|b) a or b
a? Zero or one of a
a* Zero or more of a
a+ One or more of a
a{3} Exactly 3 of a
a{3,} 3 or more of a
a{3,6} Between 3 and 6 of a

ที่มา http://php.net/manual/en/function.preg-match.php
The last bug isn't fixed until the last user is dead. (Sidney Markowitz, 1995)
บุคคลทั่วไป

Re: อยากทราบวิธีเขียน Pattern preg_match_all มันเขียนยังไง

โพสต์ที่ยังไม่ได้อ่าน โดย บุคคลทั่วไป »

ปัญหาโลกแตกมาฟังก๋ชั่นนี้ตอนอัพเกรดเวอร์ชั่นแทนจะรื้อเขียนใหม่เลย
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 83