A class designed to handle all sorts of text searches within a Document.
Search[edit]
Constructors
-
- new Search()
Creates a new Search object. The search options contain the following defaults:
...
needle:""backwards:falsewrap:falsecaseSensitive:falsewholeWord:falsescope:ALLregExp:false
Methods
-
- Search.find(EditSession session)
Searches for options.needle. If found, this method returns the Range where the text first occurs. If `...
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 Ranges where the...
Arguments
| session | EditSession | Required. The session to search with |
-
- Search.getOptions()
Returns an object containing all the search options.
Searches for options.needle in input, and, if found, replaces it with replacement. ...
Arguments
| input | String | Required. The text to search in |
| replacement | String | Required. The replacing text |
Returns
| String | If options.regExp is true, this function returns input with the replacement already made. Otherwise, this function just returns replacement.If options.needle was not found, this function returns null. |