Finding the regular expressions search in jEdit - jedit

I am not a programmer, I am a book editor, and need to automate a task. I need to be able to load my entire book into a program to add <p> before every paragraph, and </p> after each one. Currently I have to go through and entire book on notepad and manually do it.
Guido Henkel in his book "Zen of eBook Programming" describes it like this:
Copy your whole book's text into the text editor.
Run a regular expressions search and replace.
Where do I go to do a "regular expression search and replace" in the jEdit program? Does jEdit need to be set up or have plug-ins installed?
The top of the search box says "find" I have the code I am supposed to use; it's just that when I opened the program, I experienced the shock of being in a strange country. Anyone help me out?

I assume you are using jEdit editor http://www.jedit.org . No plugins are needed to just replacing text by regular expressions.
Open the Search And Replace dialog via click Search in the menu bar and select Find...
Turn on Regular Expressions, put .+ to the Search for box, put <p>$0</p> to the Replace with box then press Replace All

Related

How did they write code without a Text editor or IDE the first time?

When I started to learn programming, everyone said the first thing you need to code is a text editor or an IDE. Since then, I've been asking myself how did they program the text editor "to write the code in the future" without a text editor.
Did they write the code on paper and then put it into the computer? How?

Search and highlight a pdf within webbrowser in vb.net

I'm using a WebBrowser-Controll in vb.net for showing pdf-files, simply by doing
WebBrowser1.Navigate(output_filepath & "#view=Fit")
Acrobat Standard X and XI is used as well as IE11.
Now I'm trying to implement a search functionality for searching the pdf-files and, in case the search-term is found, focus on and highlight it. I did not realiy find a good hint. Is there a way? Which one?
Is more information needed?
I'm keen to read your hints...!
EDIT:
I want to search for words in a searchable pdf-file shown in the webbrowser-command.

Insert a word from a predefined list of words

I'm looking for a way to create a VBA script in MS Word that displays a list of predefined words. If the user clicks on one, it will be inserted into the document. Google searches only showed a way to create mailings with values from Excel but I want the words to be hard coded inside that VBA script (array maybe?) without any external files. Here is a small mockup how I imagined it:
Any ideas or tutorial links on how to achieve somehing like this? It doesn't have to look like the dialog in the image but have a collection of words in a dialog for the user to select.
Edit: It would be nice if the user would see a human readable label (like 'First name') but the inserted value would be a variable (like '$firstName').
For creating the pop-up with a list of words, you can try something like this to connect a displayed value to the actual value.
As for the inserting into text part, this post seems to address the topic. Otherwise here's something from MSDN (http://support.microsoft.com/kb/212682/EN-US)
As it turns out, Greg Maxey has already built something very close to the requested utility by leveraging the native Building Blocks and AutoText features in Word. He calls his utility "Building Block Quick Pick" and the code for it is included in a free Word template add-in that contains a suite of Building Block utilities that he has created.
An article describing his Building Block utilities (with the Building Block Quick Pick detailed near the end) can be found here:
Gregory K. Maxey on Building Blocks & AutoText
The add-in can be downloaded from here:
Gregory K. Maxey's Building Block Enhanced Tools
The Building Block Quick Pick tool can be used as is or adopted to OP's exact format.
It's worth noting that one can also just create AutoText entries, place them in a template (for example, Building Blocks.dotx) and then place the Auto Text gallery on the QAT. This will provide a visual menu that with a single click will insert text at the insertion point. Here's what this would look like:
And here's a tutorial:
How to add AutoText from WikiHow

Tool to Surround or Wrap Highlighted Text

StackOverflow's WYSIWYG has the ability to quickly surround highlighted text through keyboard shortcuts.
For example, when I push Ctrl+B on some highlighted text, it would bold the text or surround it with two stars.
I am looking for a tool that will give me this function but with "custom-input". That is... instead of bolding the word, I could surround it with a <div> tag or... in my case, I need to localize my Wordpress Plug-in, thus __("Surrounded Text").
I am currently using Notepad++ but I can't find any way to create this function.
Can this be done in Notepad++?
If it can not, I would like some suggestion for a IDE that can.
Thank you.
If you've never used an "optimized" text editor, Vim would be a sea change, but it does have a great surround.vim plugin.
Emphasize hello: ysiw<em>
<em>Hello</em> world!
Finally, let's try out visual mode.
Press a capital V (for linewise visual
mode) followed by S<p
class="important">.
<p class="important">
<em>Hello</em>> world!
</p>
Alternatively, you could probably get a fair bit of the functionality for which you are looking with an AutoHotkey script, but at best I think you'd have to do the highlight-first thing like the StackOverflow WYSIWYG editor.
Still, this would probably allow you to keep using Notepad++.
You can do this in VIM using the surround plugin

How to Pretty print VBA code?

How do you copy VBA code into a Word document and retain the VBA editor color scheme?
You can use Notepad++ to accomplish this in three ways. Just so you know, Notepad++ is a more advanced version of Notepad, which supports syntax highlighting of different code files "out of the box" - Visual Basic included!
Download & install it, fire it up, and load up your VBA code. You should automatically see it beautifully coloured (if not, because the file extension is something other than .vb, go to Language -> VB or Language -> V -> VB).
If you need to change any of the colours, you can easily do so - just go to Settings -> Styler Configurator. From that menu, you can change the various highlighting and font options, to suit your needs - although the default usually suffices for most.
Then, go to Plugins -> NppExport. From there, you have three options you can consider:
Directly print from Notepad++
Copy all formats to clipboard
Export to RTF
Export to HTML
The first is self explanatory. The second one - "Copy all formats to clipboard" - will copy the entire file with the highlighted syntax to the clipboard. Once you click it, then open Microsoft Word or your other favourite document editor, and just hit paste! You should see the beautifully syntax-highlighted code. If something goes wrong, then you can try one of the other options (export to RTF/HTML), although I've never had a problem with the clipboard method.
There are two programs on cnet downloads, which are free to try. In case you did not try them, here are the links:
VB-VBA Code Formatter & Printer 2.2
VBAcodePrint 6.13.110
Smart Indenter could be what you're looking for? You'd load the result into Notepad++, set language to VB and save as .rtf/.doc (or print to file, can't remember off the top of my head).
For a more modern approach, Sublime Text users can install ExportHTML from Package Control. This has the added benefit of being able to include the line numbers, and changing the code coloration.
HTML files can be opened directly within Word.
Highlight supports a wide range of Operating Systems and 150+ languages including Visual Basic, although I'm not sure about VBA.
I would recommend this one: planetB
It works well with Internet Explorer (didn't work wit Firefox for me, not sure abt Chrome).
Plus it's online, so no need to install anything (the case of Company/University PC's)
Regards
Wheeliam
The following works with Visual Studio Code:
Start VS Code.
New file.
Copy & Paste the VBA code into the VS Code window.
In the lower right-hand corner, click on "Plain Text" and select "Visual Basic" instead. Note that the code is now syntax-highlighted.
Copy & Paste the formatted code into Word.