A class designed to handle all sorts of text searches within a Document.
Search[edit]
Constructors
- new Search()
Creates a new Search object. The following search options are avaliable:
Creates a new Search object. The following search options are avaliable:
needle: The string or regular expression you're looking forbackwards: Whether to search backwards from where cursor currently is. Defaults tofalse.wrap: Whether to wrap the search back to the beginning when it hits the end. Defaults tofalse.caseSensitive: Whether the search ought to be case-sensitive. Defaults tofalse.wholeWord: Whether the search matches only on whole words. Defaults tofalse.range: The Range to search within. Set this tonullfor the whole documentregExp: Whether the search is a regular expression or not. Defaults tofalse.start: The starting Range or cursor position to begin the searchskipCurrent: Whether or not to include the current line in the search. Default tofalse.
Methods
- Search.$matchIterator(EditSession session)
Arguments
| session | EditSession | Required. The session to search with |
- Search.find(EditSession session)
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Arguments
| session | EditSession | Required. The session to search with |
- Search.findAll(EditSession session)
- [ Range ]
Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Arguments
| session | EditSession | Required. The session to search with |
- Search.getOptions()
Returns an object containing all the search options.
Returns an object containing all the search options.