
CHAPTER 2: The ExtendScript Toolkit The Script Editor 26
In a replace operation, you can use the captured regions of a match in the replacement expression by
using the placeholders
\1 through \9, where \1 refers to the first captured region, \2 to the second, and so
on.
For example, if the search string is
Fred\([1-9]\)XXX and the replace string is Sam\1YYY, when applied to
Fred2XXX the search generates Sam2YYY.
Syntax marking
The Script Editor offers language-based syntax highlighting to aid in editing code. Although the
debugging features (including syntax checking) are only available for JavaScript, you can choose to edit
other kinds of code, and the syntax is highlighted according to the language. The style of syntax marking is
automatically set to match the file extension, or you can choose the language from the View > Syntax
Highlighting menu.
The style of highlighting is configurable, using the Fonts and Colors page of the Preferences dialog.
\x
Escapes a character x that would otherwise have a special meaning. For example, \[ is
interpreted as a left bracket, rather than the start of a character set.
[...]
A set of characters; for example, [abc] means any of the characters a, b or c. You can also use
ranges, for example [a-z] for any lower case character.
[^...]
The complement of the characters in a set. For example, [^A-Za-z] means any character
except an alphabetic character.
^
Matches the start of a line (unless used inside a set).
$
Matches the end of a line.
*
Matches 0 or more times. For example, Sa*m matches Sm, Sam, Saam, Saaam etc.
+
Matches 1 or more times. For example, Sa+m matches Sam, Saam, Saaam and so on.
Comentários a estes Manuais