PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 1ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. <html><body>
  2. You can replace all occurrences of a specific string or regular
  3. expression with the return value of a BeanShell script if the
  4. <b>Return value of a BeanShell
  5. snippet</b> radio button is selected in the search dialog box.<p>
  6. You can use
  7. this, for example, to replace each occurrence of <quote>Windows</quote> with
  8. <quote>Linux</quote>, and each occurrence of <quote>Linux</quote> with
  9. <quote>Windows</quote>, by searching for the following regular expression:<p>
  10. <code>(Windows|Linux)</code><p>
  11. And replacing it with the following BeanShell snippet:<p>
  12. <code>_1.equals("Windows") ? "Linux" : "Windows"</code>
  13. </body>
  14. </html>