PageRenderTime 69ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 26ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/doc/tips/tip93.html

#
HTML | 20 lines | 14 code | 6 blank | 0 comment | 0 complexity | f06b2cb473c40fbbfa3df279407a34eb MD5 | raw file
 1<html><body>
 2
 3You can replace all occurrences of a specific string or regular
 4expression with the return value of a BeanShell script if the
 5<b>Return value of a BeanShell
 6snippet</b> radio button is selected in the search dialog box.<p>
 7
 8You can use
 9this, for example, to replace each occurrence of <quote>Windows</quote> with
10<quote>Linux</quote>, and each occurrence of <quote>Linux</quote> with
11<quote>Windows</quote>, by searching for the following regular expression:<p>
12
13<code>(Windows|Linux)</code><p>
14
15And replacing it with the following BeanShell snippet:<p>
16
17<code>_1.equals("Windows") ? "Linux" : "Windows"</code>
18
19</body>
20</html>