?? [m?t?]

n. ??; ??(?? ??)

vt. ???? ???

vt.& vi.

3?? ??: ?? ??: ?? ?? ??: ?? ?? ??: ?? ?? ??: ??

?????? match() ??? ???

??: ??? ??? ??? ?? ????? ?? ??? ?? ???? ???? ??? ?? ? ????. ? ???? indexOf() ? lastIndexOf()? ????? ??? ??? ?? ??? ?? ?????.

??: ??stringObject.match(???), stringObject.match(regexp).

????: searchvalue ?????. ??? ??? ?? ?????. ?? ??? ?????. ???? ??? ???? RegExp ?????. ????? RegExp ??? ?? ?? ?? RegExp ???? ???? RegExp ??? ???? ???.?

Return: ???? ??? ???? ?????. ? ??? ??? regexp? ?? ??? g? ??? ??? ?? ?????.

??: match() ???? ??? stringObject? ???? ?? ???? ???? ?? ??? ???? ????. ? ??? ??? regexp? ??? g? ??? ??? ?? ?? ?????. ???? g ???? ??? match() ???? stringObject? ???? ??? ??? ? ????. ???? ???? ??? match()? null? ?????. ??? ??? ?? ?? ???? ?? ??? ??? ??? ?????. ??? 0?? ???? ???? ???? ???? ??? ???? ???? ?? ???? ???? ???? ?????. ??? ?? ?? ?? ??? ??? ???? ? ?? ?? ??? ???? ????. index ??? stringObject?? ???? ???? ?? ?? ??? ????, input ??? stringObject? ?? ??? ?????. ???? ??? g? ??? match() ???? ?? ??? ???? stringObject?? ???? ?? ?? ???? ????. ???? ?? ???? ??? null? ?????. ???? ?? ???? ?? ?? ???? ??? ?????. ??? ?? ???? ??? ??? ??? ?? ?? ??? ?? ???, ?? ?? ??? ???? ?? ?? ???? stringObject? ???? index ???? ?? ??? ????.

??: ?? ?? ???? match()? ?? ???? ???? ???? ?? ??? ???? ??? ???? ? ?? ???? ??? ??????? ????. ????? ??? ??? ??? ?? RegExp.exec()? ??? ? ????.

?????? match() ??? ?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    var str="Hello world!"
    document.write(str.match("world") + "<br />")
    document.write(str.match("World") + "<br />")
    document.write(str.match("worlld") + "<br />")
    document.write(str.match("world!"))

</script>

</body>
</html>

???? ?? ?

??? ????? ??? "???? ??" ??? ?????