Hướng dẫn php preg_match check if string contains - php preg_match kiểm tra xem chuỗi có chứa

Trong Regex [_]$ của bạn có nghĩa là dấu gạch dưới ở cuối chuỗi. Đó là lý do tại sao nó không phù hợp với của bạn.

Nếu bạn chỉ muốn kiểm tra dấu gạch dưới khi kiểm tra ở bất cứ đâu tại chuỗi, thì:

if (preg_match('/_/', $str)) {

Nếu bạn muốn kiểm tra chuỗi phải bao gồm các số và nhấn mạnh, thì

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned

Nhưng đối với đầu vào mẫu của bạn 12_322, cái này cũng có thể tiện dụng:

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {

mohammad40g tại gmail dot com ¶

Andre tại Koethur Dot de ¶Perform a regular expression match

Sainnr tại Gmail Dot Com ¶

cmallabon tại homesfactory dot com ¶(
    string $pattern,
    string

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
0,
    array
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
1 =
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
2
,
    int
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
3 = 0
,
    int
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
4 = 0

): int|false

geompse tại gmail dot com ¶

5 năm trước

Workhorse tại op dot pl ¶

Aer0s ¶

Kae cyphet ¶

Splattermania tại Freenet Dot de ¶

Ẩn danh ¶

ian_channing tại hotmail dot com ¶

Corey [hoạt động tại] effim [xóa] .com ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
1

Nếu lá cờ này được thông qua, với mỗi lần xảy ra, phần bù chuỗi phần phụ (tính bằng byte) cũng sẽ được trả về. Lưu ý rằng điều này thay đổi giá trị của

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
7 thành một mảng trong đó mọi phần tử là một mảng bao gồm chuỗi phù hợp ở độ lệch
if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
3 và chuỗi của nó bù thành
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
6 khi bù
if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
5.

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
6

Ví dụ trên sẽ xuất ra:

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
7

Nếu lá cờ này được thông qua, các tiểu mẫu chưa từng có được báo cáo là

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
2; Nếu không, chúng được báo cáo là một chuỗi trống.
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
2
; otherwise they are reported as an empty string.

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
9

Ví dụ trên sẽ xuất ra:

array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}

Nếu lá cờ này được thông qua, các tiểu mẫu chưa từng có được báo cáo là
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
2; Nếu không, chúng được báo cáo là một chuỗi trống.

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0

Thông thường, tìm kiếm bắt đầu từ đầu chuỗi chủ đề. Tham số tùy chọn

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0 có thể được sử dụng để chỉ định vị trí thay thế để bắt đầu tìm kiếm (tính bằng byte).:

Ghi chú:preg_match() in place of the subject string, because

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
5 can contain assertions such as ^, $ or (?<=x). Compare:

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
5

Ví dụ trên sẽ xuất ra:

Nếu lá cờ này được thông qua, các tiểu mẫu chưa từng có được báo cáo là

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
2; Nếu không, chúng được báo cáo là một chuỗi trống.

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
6

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)

Thông thường, tìm kiếm bắt đầu từ đầu chuỗi chủ đề. Tham số tùy chọn

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0 có thể được sử dụng để chỉ định vị trí thay thế để bắt đầu tìm kiếm (tính bằng byte).substr(), use the
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
7 assertion rather than the
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
8 anchor, or the
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
9 modifier instead, both of which work with the
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0 parameter.

Ghi chú:

Sử dụng

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0 không tương đương với việc chuyển
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
3 cho preg_match () thay cho chuỗi chủ đề, bởi vì
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
5 có thể chứa các xác nhận như ^, $ hoặc (?
returns 1 if the
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
5 matches given
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
6, 0 if it does not, or
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3
on failure.

trong khi ví dụ này

sẽ sản xuất

array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3, but may also return a non-Boolean value which evaluates to
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3
. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

Errors/Exceptions

Ngoài ra, để tránh sử dụng chuỗi con (), sử dụng xác nhận

Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
7 thay vì neo
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
8 hoặc công cụ sửa đổi
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
9, cả hai đều hoạt động với tham số
Array
(
    [0] => Array
        (
            [0] => foobarbaz
            [1] => 0
        )

    [1] => Array
        (
            [0] => foo
            [1] => 0
        )

    [2] => Array
        (
            [0] => bar
            [1] => 3
        )

    [3] => Array
        (
            [0] => baz
            [1] => 6
        )

)
0.
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
6
is emitted.

Trả về giá trị

preg_match () trả về 1 nếu
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
5 khớp với
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
6, 0 nếu không hoặc
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3 khi thất bại.
Cảnh báo
7.2.0 Hàm này có thể trả về Boolean
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3, nhưng cũng có thể trả về giá trị phi Boolean đánh giá thành
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
3. Vui lòng đọc phần về Booleans để biết thêm thông tin. Sử dụng toán tử === để kiểm tra giá trị trả về của hàm này.
if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
7
is now supported for the
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
3 parameter.

Nếu mẫu regex được truyền không biên dịch cho một regex hợp lệ, một array(4) { [0]=> string(2) "ac" [1]=> string(1) "a" [2]=> string(0) "" [3]=> string(1) "c" } array(4) { [0]=> string(2) "ac" [1]=> string(1) "a" [2]=> NULL [3]=> string(1) "c" } 6 sẽ được phát ra.

Thay đổi

array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  string(0) ""
  [3]=>
  string(1) "c"
}
array(4) {
  [0]=>
  string(2) "ac"
  [1]=>
  string(1) "a"
  [2]=>
  NULL
  [3]=>
  string(1) "c"
}
9

Phiên bản

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
0

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
1

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
2

Sự mô tả

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
3

Ví dụ trên sẽ xuất ra:

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
7 hiện được hỗ trợ cho tham số
if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
3.

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
4

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
5

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
6

Ví dụ trên sẽ xuất ra:

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)

Ví dụ

Ví dụ #1 Tìm chuỗi văn bản "PHP"

Ví dụ #2 Tìm từ "Web"preg_match() if you only want to check if one string is contained in another string. Use strpos() instead as it will be faster.

Ví dụ #3 Lấy tên miền từ URL

  • Ví dụ #4 Sử dụng Subpotyn được đặt tên
  • Ghi chú
  • Mẹo
  • Không sử dụng preg_match () nếu bạn chỉ muốn kiểm tra xem một chuỗi có chứa trong chuỗi khác không. Sử dụng strpos () thay vào đó vì nó sẽ nhanh hơn.
  • Xem thêm
  • Mẫu pcre
  • preg_quote () - Trích dẫn các ký tự biểu thức chính quy

preg_match_all () - Thực hiện phù hợp với biểu thức chính quy toàn cầu

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
7

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
8

Array
(
    [0] => Array
        (
            [0] => def
            [1] => 0
        )

)
9

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
1

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
2

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
3

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
4

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
6

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
7

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
8

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
9

[_]$0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

[_]$1

[_]$2

[_]$3

[_]$4

[_]$5

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

lực tại md-t dot org ¶

[_]$7

[_]$8

[_]$9

12_3220

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

11 năm trước

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

12_3222

12_3223

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

12_3225

12_3226

12_3227

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

lực tại md-t dot org ¶

12_3228

12_3229

$pattern0

$pattern1

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

11 năm trước

Mrbull ¶

$pattern3

$pattern4

$pattern5

$pattern6

$pattern7

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Ruakuu tại Nospam Dot Com ¶

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

$pattern9

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
00

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

lực tại md-t dot org ¶

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
02

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
03

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
04

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
05

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

11 năm trước

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
07

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
08

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
09

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
10

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
12

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
13

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
14

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
16

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
17

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
19

preg_split () - Chuỗi phân chia theo biểu thức thông thường

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
20

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
21

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
22

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
23

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
24

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
25

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
26

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
27

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
29

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
30

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

Mrbull ¶

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
32

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
33

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
34

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Ruakuu tại Nospam Dot Com ¶

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
36

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
37

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
38

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
39

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_last_error_msg () - Trả về thông báo lỗi của lần thực thi pcre regex cuối cùng

preg_replace () - Thực hiện tìm kiếm biểu thức thông thường và thay thế

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
41

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
42

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
43

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
44

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

preg_split () - Chuỗi phân chia theo biểu thức thông thường

Mrbull ¶

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
46

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
47

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
48

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
49

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
50

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
51

Ruakuu tại Nospam Dot Com ¶

preg_last_error () - Trả về mã lỗi của thực thi pcre regex cuối cùng

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
52

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
53

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Jonny 5 ¶

10 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
55

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
56

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Akniep tại Rayo Dot Info ¶

13 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
58

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
59

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
60

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
61

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
62

Nimja ¶

10 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
63

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
64

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
65

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
60

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
67

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
68

Akniep tại Rayo Dot Info ¶

13 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
69

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
70

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
71

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
72

Nimja ¶

Son9ne tại gmail dot com ¶

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
73

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
74

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
75

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
76

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
77

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
78

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
79

12 năm trước

13 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
80

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
81

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
82

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
83

Nimja ¶

10 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
84

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
85

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Son9ne tại gmail dot com ¶

12 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
87

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
88

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
89

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
90

Yousef Ismaeil cliprz ¶

12 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
91

Yousef Ismaeil cliprz ¶

13 năm trước

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
92

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
93

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
94

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
95

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
96

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
97

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
98

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
99

Nimja ¶

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
00

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
01

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
02

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
03

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Nimja ¶

12 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
05

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
06

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Yousef Ismaeil cliprz ¶

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
08

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
09

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
10

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

Nimja ¶

Son9ne tại gmail dot com ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
12

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
13

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
14

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
15

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
16

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
17

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

12 năm trước

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
19

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
20

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
71

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
22

Nimja ¶

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
23

Nimja ¶

Son9ne tại gmail dot com ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
24

12 năm trước

Yousef Ismaeil cliprz ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
25

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
26

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
27

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
28

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
29

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
30

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

12 năm trước

Yousef Ismaeil cliprz ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
32

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
33

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
34

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
35

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

9 năm trước

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
37

ian_channing tại hotmail dot com ¶

13 năm trước

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
38

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
49

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
40

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
41

Nimja ¶

Son9ne tại gmail dot com ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
42

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
43

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

12 năm trước

Yousef Ismaeil cliprz ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
45

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
46

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
47

Array
(
    [0] => foobar: 2008
    [name] => foobar
    [1] => foobar
    [digit] => 2008
    [2] => 2008
)
0

9 năm trước

ian_channing tại hotmail dot com ¶

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
49

if (preg_match('/^[1-9_]+$/', $str)) {  // its 1-9 you mentioned
49

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
51

if (preg_match('/^[1-9]+_[1-9]+$/', $str)) {
52