Comments (7)
I want to add a prefix -= and suffix =- to each multi-selected words
As N++ doesn't support multiselected text as the result of a search, the way to achieve something like that is doing a replace instead, where you add in the -=
/ =-
(or whatever) delimiters as part of the Replace with text expression.
from notepad-plus-plus.
Before claiming that any regex implementation lacks the capability to do X, you should learn about the capabilities of the regex engine and fully articulate what you want, including examples of things that should and should not match your regex.
Until you provide some examples, nobody is going to be inclined to give you any assistance beyond recommending that you read the documentation.
from notepad-plus-plus.
Until you provide some examples
...which would have taken care of itself if @alienfxfiend had submitted an issue using the issue template.
Suggest closing this issue until such is provided.
from notepad-plus-plus.
Oh sorry, I cannot use this RegEx select: (http://[^\s]+) to Replace links into this (add wrapping Angle Brackets surrounding it): <$1> (it only selects the first occurrence, (& I remember reading about how NPP does not support this kind of multi-selects (I think, in an AI model prompt)).)
from notepad-plus-plus.
Don't ask large language models (LLMs) about Notepad++. They will mostly tell you lies. This is because there just isn't enough true information about Notepad++ in their training data.
I would also discourage using LLMs for regex. There are better sources; I think StackOverflow is better. It is still useful to learn how regular expressions work, so that if you find a regular expression that doesn't work for you, you can modify it to make it work better. In your example, (http://[^\s]+)
only matches URLs with the http
protocol, whereas you probably want to match the https
protocol as well.
In any case, a quick DuckDuckGo search for url match regex
turned up this StackOverflow post, from which I got a regular expression that I modified slightly to (?-i)https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
Also, you don't need to wrap the regular expression in grouping parentheses in Notepad++. If you want to wrap some text
in ()
, you can just regex-replace some text
with (${0})
, because Notepad++ supports backreferences to the entire captured string as ${0}
.
from notepad-plus-plus.
Apologies, I was addressing the wrong issue. So I have a list of words & I want to add a prefix -= and suffix =- to each multi-selected words, but the "In Selection" in the "Replace" dialog grays out the option. The result is every word in the current document gets the delimiters -= & =- .I need NPP to allow me to add prefix -= & suffix =- to multiple selections of words among a text. I used this RegEx: \b(\w+)\b & replaced with: -=$1=- .This is why I said NPP doesn't have this functionality. Links can be wrapped in Angle-Brackets but multiple words among many cannot using RegEx ! Please try to fix this in the future. For example:
These words:
- Agitated 2. Curmudgeon 3. Plankton
I select Curmudgeon & Plankton (Ctrl+double-click both) then Ctrl+H Replace dialog, the "In Selection" is grayed out. I need to be able to apply multiple-wrapped-prefix\suffix to words to only multiple dispersed selected words —should look like this: - Agitated 2. -=Curmudgeon=- 3. -=Plankton=-
But the whole document's words are replaced. If there's another RegEx to do this let me know (this is the limitation the AI was speaking of.)
P.S: More importantly, there's no way to apply this RegEx if it's more than one word!!!
P.P.S: The problem appears to be I cannot apply a phrase to wrap (.*) and then use the same Replace RegEx on a word \b(\w+)\b Could this be fixed?
from notepad-plus-plus.
O.K. I got it all sorted, thank you. Sorry for the bewildering lengthy posts /w so many issues being listed. In the end, Notepad++ has a robust solution to these problems !
from notepad-plus-plus.
Related Issues (20)
- [Feature request] Simplify Macro warning message on upgrade
- [Feature request] Redirect to open the same file when using multiple windows (multiple instances)?
- [BUG] Dark mode for command argument help, Wingup Dialog, Print dialog HOT 1
- [BUG] translation missing"Can not start printer document" HOT 1
- [Feature request] organize Toolbar HOT 1
- [BUG] File:// link with encoded character doesn't open
- [Feature request] Add support to associate files extensions with language by default HOT 2
- [BUG] Macros mangle my files HOT 2
- [BUG] Typo in config.xml GUIConfig setting: "MaitainIndent" HOT 1
- [Feature request] Add a group layer for files HOT 2
- [Feature request] Duplicate selected lines, new command HOT 1
- [Feature request] Allow plugins to get/set the existing color choice for a tab HOT 1
- [BUG] Raku file extension not recognized automatically + Syntax highlighting in default theme (light mode) not working HOT 2
- [BUG] Symbol '&' in a File name makes it like an access key and we see an underscore in place of it
- [BUG][Code] Code for `WM_COMMAND` outside of it in preferenceDlg.cpp HOT 1
- Move config in seperate folder HOT 3
- [Feature request] Auto-indentation in Python
- [Feature request] NOT "Hide pointer while typing" HOT 1
- [Feature request] <Adding an optional option to Auto-indent when Pasting Multiple Lines> HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notepad-plus-plus.