Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Selection Object > Methods

EmEditor Macro Reference: Find Method

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Selection Object

Find Method

Searches for the specified string.

[JavaScript]

nFound = document.selection.Find( strFind, nFlags[, nExFlags] );

[VBScript]

nFound = document.selection.Find( strFind, nFlags[, nExFlags] )

Parameters

strFind

Specifies a string to search for.

nFlags

Specifies a combination of the following values:

eeFindAround

Moves to the start of the document when reaches the end of the document.

eeFindBookmark

Sets bookmarks on lines where the string is matched.

eeFindCount

Counts the occurrences of the matched string.

eeFindExtract

Extracts matched lines to a new document. Combine with eeFindFileAndLine, eeFindFileNamesOnly, eeFindLineOnly, or eeFindMatchedOnly. If none of these flags is combined, eeFindLineOnly is assumed.

eeFindFileAndLine

File names, line numbers, and the whole lines containing the searched string will not be displayed as results. Must combine with eeFindExtract. Cannot combine with eeFindFileNamesOnly, eeFindLineOnly or eeFindMatchedOnly.

eeFindFileNamesOnly

Only file names will be displayed and the whole lines containing the searched string will not be displayed as results. Must combine with eeFindExtract. Cannot combine with eeFindFileAndLine, eeFindLineOnly or eeFindMatchedOnly.

eeFindLineOnly

Only the whole lines containing the searched string will be displayed as results. Must combine with eeFindExtract. Cannot combine with eeFindFileAndLine, eeFindMatchedOnly or eeFindFileNamesOnly.

eeFindMatchedOnly

Only the matched strings will be displayed as results. Must combine with eeFindExtract. Cannot combine with eeFindFileAndLine, eeFindFileNamesOnly or eeFindLineOnly.

eeFindNext

Searches downward from the cursor position.

eeFindMatchDotNL

The regular expression "." can match new lines characters.

eeFindOutput

Displays the Extract results as a list in the Output Bar. Must combine with eeFindExtract.

eeFindPrevious

Searches upward from the cursor position.

eeFindReplaceCase

Matches cases.

eeFindReplaceEmbeddedNL

Matches embedded newlines in CSV documents and does not match other newlines.

eeFindReplaceEscSeq

Uses escape sequences. Cannot be combined with eeFindReplaceRegExp.

eeFindReplaceOnlyWord

Matches only whole words.

eeFindReplaceOpenDoc

Searches all open documents in the same frame window.

eeFindReplaceQuiet

Does not display a message on the status bar if no string is found.

eeFindReplaceRegExp

Uses a regular expression for the searched string. Cannot be combined with eeFindReplaceEscSeq.

eeFindReplaceSelOnly

Searches only in the selection.

eeFindSaveHistory

Saves the searched string for repeated search.

eeFindSelectAll

Selects all matched strings.

nExFlags

Specifies a combination of the following values. However, only one of eeExFindRegexBoost and eeExFindRegexOnigmo can be specified. If none of these two is specified, the default regular expression engine is used.

eeExFindRegexBoost

Uses Boost.Regex as the regular expression engine.

eeExFindRegexOnigmo

Uses Onigmo as the regular expression engine.

eeExFindSeparateCRLF

Treats CR and LF separately.

Return Values

Returns 1 if the searched string is found, or 0 if not found. However, if the eeFindCount, eeFindBookmark, eeFindSelectAll, eeFindExtract flag is specified, the return value is the number of the occurrences of the matched string in the document.

Version

Supported in EmEditor Professional Version 4.00 or later.

Copyright © 2003-2016 by Emurasoft, Inc.