Replacing comma with a dot in Notepad++ [closed] - regex

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am using Notepad++ and want to replace a comma coming in between numbers with a dot.
Like in below text file:
00:00:00,166 --> 00:00:03,999
In this section we will look at
should be like below:
00:00:00.166 --> 00:00:03.999
In this section we will look at
Thanks

Try this:
Find:
(?<=\d),(?=\d)
Replace with:
.
Here is a screenshot. Make sure you select Regular Expression radio button (pointed to by arrow).
Regex:
(?<=\d) - Positive look behind for a digit char
(?=\d) - Positive look ahead for a digit char
Demo:
https://regex101.com/r/iw1XsV/1

Related

Regex pattern to replace characters [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
The program contains text of this type:
A B Ccccc
A Ccccc
ACcccc
ABCcccc
I need only such text to remain:
Ccccc
I wrote a replacement function, but I just can’t pick up a pattern
How to make such a pattern?
No need for regex, nor VBA. It seems you simply are looking for the position of the last upper-case letter and then to extract from there:
Formula in B1 (with Excel O365):
=MID(A1,MAX(SEQUENCE(LEN(A1))*(EXACT(UPPER(MID(A1,SEQUENCE(LEN(A1)),1)),MID(A1,SEQUENCE(LEN(A1)),1)))),LEN(A1))
If you don't have Excel O365:
=MID(A1,MAX(ROW(A1:INDEX(A:A,LEN(A1)))*(EXACT(UPPER(MID(A1,ROW(A1:INDEX(A:A,LEN(A1))),1)),MID(A1,ROW(A1:INDEX(A:A,LEN(A1))),1)))),LEN(A1))
You probably need to enter as array through: CtrlShiftEnter
If you must go through VBA and regex then a pattern like:
[A-Z][^A-Z]*$

Is there a Notepad++ RegEx to remove everything but digits and spaces? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there a RegEx to remove everything but digits and spaces in Notepad++?
I know there is one that removes only digits but i dont need that.
PS: I do not want the lines to be removed
Example:
11234123 alex-james
1412412 mmafsmasdas
After regex:
11234123
1412412
As the pattern use [^\d ]+. Almost what Poul Bak proposed, but change * into +, i.e. the sequence of chars to match should be non-empty.
There is no point in searching for an empty string and replace it with another empty string.
correction:
try this:
([^0-9| ]+)
this will surely work!!!
open the file in notepad++ press CTRL+H check the box with search mode regular expression and put in the above regex and click replace all

regex find and replace characters inside html comment [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Please help in below matter:
I would like to find character (in my case: --) and replace with other (in my case: zz, or **) but only inside html comments (<!-- -->).
Thank you in advance.
If the regex flavor supports the \G anchor, it is done like this
Global find with (<!--(?=[\S\s]*?-->)|(?!^)\G)((?:(?!--)[\S\s])*?)(--)(?!>)
replace with $1$2zz or $1$2**
If the \G anchor is not supported it can be done with a
callback.
Match the comment <!--([\S\s]*?)--> in a replace call,
then in callback replace any -- in group 1 with zz or **, return the new comment (possibly unchanged) to the original replacement.
Construct it like return "<!--" + newcontent + "-->";

Regular expression to match 2 words that are not seperated by a dot (.) so they are part of the same sentence [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I am interested in finding combinations of 2 words that appear in the same sentence.
For example:
Looking for "hello" & "There" that are in the same sentence.
My name is Danny. Hello. I am there. whats up ? <-- NO MATCH
My name is Danny. Hello there. whats up ? <-- MATCH
The rule is simple - I dont want a dot character (.) top appear between the 2 words.
You might want to try this:
\b(H|h)ello\b[^.]+\b(T|t)here\b
It matches Hello There, Hello there, or hello there, depending on the case.
Demo is here.

Regex to search for everything before a string, and after [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I would like to search for everything before the string http://thepaperwall.com/wallpapers/ but not including that string.
I would also like to search for everything after .jpg but not including .jpg.
So my final string should look like this:
http://thepaperwall.com/wallpapers/cityscape/small/small_642331afcd78d0840485bb352d99b289b50e8467.jpg
How can I do this?
You can use look-behind and look-ahead to get a string position between 2 other strings:
(?<=http://thepaperwall.com/wallpapers/).*(?=\.jpg)
You need a non-capturing group:
(.*)(?:http:\/\/thepaperwall\.com\/wallpapers\/.*\.jpg)(.*)
Live demo