Notepad++ ignoring end delimiter of RegEx [closed] - regex

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a JSON file. There is some information I want to delete and the process would be quite tedious to be done manually, and incredibly quick to perform through RegEx.
I want to find matches starting by, let's say, "abc" (including quotes), composed by any set of characters (including conflicting ones like brackets), and ending by , (the comma character), new line and " (left quote character).
Although RegEx is not my best strength, I have read several questions that could be related, like this one, and tried out several patterns, being this the one in which I believe the most:
"abc"(.*),^"
But it doesn't work properly. It starts fine, but the part after the (.*) is completely ignored, so the rest of the text in the document is selected instead of only what I requested.

^ doesn't mean newline. It's a "zero-length anchor" that matches the position before the first character of a line.
You want something like
"abc"(.*),\r?\n"

Related

Replace number with double quotes from csv file using vi editor [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I have a CSV file containing the data like below -
"Rank","Domain","Open Page Rank"
"1","fonts.googleapis.com","10.00"
"2","facebook.com","10.00"
"3","twitter.com","10.00"
"4","google.com","10.00"
"5","youtube.com","10.00"
"6","instagram.com","10.00"
"7","s.w.org","10.00"
"8","ajax.googleapis.com","10.00"
"9","linkedin.com","10.00"
How can I remove double quotes from all numbers here using vi editor or similar effect?
Thanks
you could use a regex search and replace:
%s/"\(\d\+\(\.\d\+\)\?\)"/\1/g
"on every line in the file, find...
all strings that start with a double quote...
followed by one or more digits...
optionally, followed by a period, which is followed by one or more digits...
followed by a double quote...
replace the string with the outer capture group...
and do it everywhere it appears on the line.
"

how to remove string before second ":" in notepad++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I want to get last two strings email#email.com:namesurname from those strings. I know how to remove the last item after : with :.* but how can i do that for first also for those below? Just give me a recommendation if anyone can.
jobapplication:::2017-05-29:email#email.com:namesurname
also like this one:
skills:email#email.com:namesurname
I dont have idea to start it and there are around 3200 job applications.
Use the regular expression ^.+\:(?=\w+\#) to find unwanted string then replace all matches by empty string.
Have you considered recording a quick macro in which you do it once, replace or whatever, then press home home and down arrow to advance to the next line? Then you could do Run For Rest of File and it'd be done. (Make a backup first. ;)) I find the quick macro feature of Notepad++ comes in handy for this kind of thing, and easier (for some of us) to remember how to use than arcane regexes.

Remove parenthesis but keep number [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm editing a large MS Word document (113 pages) that has a lot of numbers surrounded by parenthesis, ie: (1) (2) (3) etc. The numbers are used for references which are given at the end of each 'chapter' and so they need to be kept.
How can I remove the parenthesis but keep the numbers which, in turn, need to turned into superscript?
Is there a way of using regexp to do this?
Thanks in advance for any help you can give.
Do a Find and Replace in Word, using the following settings:
Find: \(([0-9]{1,})\)
Replace: \1
Format: superscript
The formatting option for the "replace" is at the bottom of the "Find and Replace" dialog.
Regex breakdown:
The \( and \) surrounding the expression are the literal parens you are matching.
The inner ( and ) are grouping parens to capture the text that matches the pattern inside.
[0-9]{1,} matches one or more digits
In the replace pattern, \1 refers back to the first matched group (in this case, there's only one: the digits inside the parens).

Is there a spelling library that recognizes incomplete words? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
My use case is the following: given a string, recognize all valid words starting at the beginning of the string. For example:
blueberryqqq
should output:
blue
blueberry
To do that, I have a dictionary structure that uses a trie<char>. For example, if my dictionary consists only of the two words above, it would like this:
b->l->u->e->\0
->b->e->r->r->y->\0
When I investigate my input string, the spell-checking process can tell me, as I go from letter to letter whether:
I'm on the path to a valid word
I have found a valid word
I am not on the path to a valid word
Note that these are flags and both 1 and 2 can be true at the same time. With that approach, I can efficiently find both blue and blueberry in one go and stop trying immediately when I reach the y. Continuing with the example, here's what happens as I go from letter to letter:
b:1, l:1, u:1, e:1|2, b:1, e:1, r:1, r:1, y:2
When I see 1|2, I know that "blue" is valid word but I also know to keep going further down the string because my dictionary tells me there are more words possible. Once I reach the y, I stop. Quite efficient as I visit each letter only once for all valid words and I stop spell-checking as soon as the dictionary tells me there is no point in going further. Perfect!
My problem is that my dictionary trie is built from /usr/share/dict/words and that file does not contain the plural form of "bluberry" which is "blueberries" and in general won't contain all the "derivatives" of all the words. So if the input string is blueberriesqqq, I will only get blue as valid.
If I were to use a spell-checking library like aspell or hunspell, as far I as I can tell, I would need to spellcheck all sub-strings individually! e.g. b, bl, blu, etc. Quite inefficient! Not only that, but I wouldn't know when to stop checking. e.g. How do I know there aren't any words that start with blueberriesqq?
So, my question becomes: is there a spell-checking library out there that would accommodate my use case?
Note that spelling suggestions wouldn't cut it. Passing blueb to aspell does not return any spelling suggestions which start with blueb. Thus, I would end my search even though there is still the possibility of more valid words down the line.

How to use regex to find if a text contains specific words? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am using a file search tool which can use regex to find files which contain certain text. My regex skills are pretty simple. (I am going to assume the file is treated like a single text with some line breaks)
Let's say I want to find files which contain these 3 words: route, boy & skill.
How to create two regex's, one to search for those words where each word needs to be a whole word (white space before or after, at beggining or end of line), and another regex where one or more words could be part of another word (like substring function)?
Update
I am not interested in regex tutorials and testers. If I need one, I certainly can google for one and find dozens. This is a regex that I simply can't create but which I will use over and over in that tool. Maybe regex doesn't support what I want and a regex expert can tell me that's the case. So no amount of regex tutorials and testers is going to help. I appreciate the links but they are not going to help me here.
Try following regular expression:
(?=.*\broute\b)(?=.*\bboy\b)(?=.*\bskill\b)