• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Core Syntax > String.search()

String.search()

JavaScript1.2+, JScript3.0+ NES3+, Nav4+, IE4+ Syntax

							string.search(regexpression)

Description

The search() method of an instance of the String object searches the string in which it is invoked for the regular expression passed to the method. The regular expression is made up of a pattern and flags that dictate what is to be matched. The method returns the indexed start location of the string if it is found and –1 if the string does not contain a regular expression match.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint