File: tip93.html

package info (click to toggle)
jedit 5.5.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 14,720 kB
  • sloc: java: 103,377; xml: 96,521; makefile: 43; sh: 42; cpp: 6; python: 6
file content (20 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html><body>

You can replace all occurrences of a specific string or regular
expression with the return value of a BeanShell script if the
<b>Return value of a BeanShell
snippet</b> radio button is selected in the search dialog box.<p>

You can use
this, for example, to replace each occurrence of <quote>Windows</quote> with
<quote>Linux</quote>, and each occurrence of <quote>Linux</quote> with
<quote>Windows</quote>, by searching for the following regular expression:<p>

<code>(Windows|Linux)</code><p>

And replacing it with the following BeanShell snippet:<p>

<code>_1.equals("Windows") ? "Linux" : "Windows"</code>

</body>
</html>