regex two first letters [closed] - regex

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
How do read two first letters and delete line?
This code remove all line where is GG
.*gg.*.*.*
ggang - delete
gangg -undelete

Tested in notepad++:
find: ^(gg.*)$
replace: (leave blank)
in:
ggang
gangg
out:
gangg

Related

regex match only two group [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 6 months ago.
Improve this question
I want to receive in example regex match only 17 and 20 (skip 3 match only two match)
Depending on what you want to do, this one can be a good solution
[0-9]{2}(?!$)
It matches the groups of 2 digits not at the end of a line !
You can also try : ([0-9]{2})\s[A-z]+\s([0-9]{2}) if you want only 2 groups

How to move ip adresses to the end of line in Notepad++ [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 4 years ago.
Improve this question
I have the data as follows in txt:
136.40.226.97|ubnt|ubnt|
138.197.81.94|listd|54e172662|
138.68.254.243|wordpress|wordpress|
139.162.55.12|public|public|
139.60.58.136|system|OkwKcECs8qJP2Z|
I want to convert it to this:
|ubnt|ubnt|136.40.226.97
|listd|54e172662|138.197.81.94
|wordpress|wordpress|138.68.254.243
|public|public|139.162.55.12
|system|OkwKcECs8qJP2Z|139.60.58.136
In Find and Replace window Ctrl+H change Search Mode to Regular expression and set:
Find what: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(.*)
Replace with: (\2)(\1)
This will find too groups: IP(1), rest of line(2), then Replace writes them in inverted order.

A simple regex call to replace some text in Eclipse [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 7 years ago.
Improve this question
I need help with a really simple regex find/replace command for Eclipse. It'd be great if you could provide me with something to try.
I need to replace all occurrences of the text typeSingleton(*) ), with typeSet({ * } ).
Assume that inside brackets you may have letters, brackets, spaces, then:
Find: typeSingleton\(([a-z ]+(\([a-z ]+\))? ?)\)
Replace: typeSet({$1})
EDIT
Demo: https://regex101.com/r/dD0wK0/1

C# Regex Replace string with Ignore specific word [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 8 years ago.
Improve this question
I have File and I want to replace fix character * : ~ with # using regex but, it should not replace(ignore) B~~ word because, it need to remain as it is. Anybody have idea for that?
Input :
ABCHKLJNKL*dskjnsdfkdsmflkmdls
MLKMLKMLKMLKMLKMMML
zlmlkmm:skjnjnskfjnkjsdnkfjnkdjs
B~~KJNNKJNJNKKJNKJNFKKJNJNK
Output Should be :
ABCHKLJNKL#dskjnsdfkdsmflkmdls
MLKMLKMLKMLKMLKMMML
zlmlkmm#skjnjnskfjnkjsdnkfjnkdjs
B~~KJNNKJNJNKKJNKJNFKKJNJNK
Please provide regex because i want to done with one step.
Thanks
[*:]|(?<!B[~])[~](?![~])
Try this.This should do it.See demo.Replace by #.
https://regex101.com/r/tX2bH4/66

how to get first word after phrase with regex [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
How do you find the first word after a string literal via regex?
I.e.
I want to extract "DAQJ7PS" from the line:
ERROR service.PostService - Failed to save post DAQJ7PS
/ERROR service\.PostService - Failed to save post (.+)/
will give you the result in the first capturing group. This can be tuned if you have more specific requirements.