Notepad++ Regex assistance needed - regex

I have the following example:
assert(apply_patch_check("/system/app/ApplicationsProvider.odex", "31bdc8cc9a131131f97a931933723c0fa6c786ba", "c996ebe1ab91e780dc9b6a41c18214c633413dc4"));
set_progress(0.000153);
assert(apply_patch_check("/system/app/AtciService.odex", "09003fce87c178afb603f4ad7fd9db2e612d0648", "aa28dfd656fd12f38f904f85f85f432a822e7719"));
set_progress(0.000386);
what I need is only:
/system/app/ApplicationsProvider.odex
/system/app/AtciService.odex
How to do that with notepad++

Find what: ^[^"]*"([^"]*).*$
Replace with: \1
Basically use first and second quotation mark to extract text that is in between them.

Try this one too
Find what: (sys.*dex)|.\s? or .*(sys.*dex).*\W
Replace with: $1

Related

In Notepad ++: Replacing some string with something else in all the lines containing another string

In the example below, is there any way to place a string like ("1one1") before {",} at the end of all lines which contain {ī}?
īn:"ZZin",
ín:"FFin",
ǐn:"QQin",
ìn:"TTin",
ie:"XXie",
iē:"TTie",
ié:"GGie",
Thanks
Using Notepad++ regex search for ^(.*ī.*)(",)$ and replace with \11one1\2.
You will need to use regex regex for notepad++.
so, mark "Regular Expression" in the final of Replace box.
in your fields to search:
find what: ī.[^"]"([A-Za-z0-9]*)
replace with: īn:"\11one1
i think it will do what you want. Let me know if it doesn't to edit the regex.

Notepad++ Remove text before characters but have 2 same characters on every line

Hi masters i need your help on Notepad++ RregExpp
i have text like this :
01:example#mail.com:test
need to convert like this :
example#mail.com:test
Thank you in advance if you help me.
Use expression ^... and replace it with empty string or better with \n like following (and remove the first two characters):
Here is a way to go:
Ctrl+H
Find what: ^[^:]+:(.+)
Replace with: $1
Replace all
Make sure to have checked Regular expresion but NOT . matches newline

Switching values

I am struggling with a generic regex to switch values around.
I want a quick way to rearrange
{"AAA","AA1"},
into
{"AA1","AAA"},
ideally using notepad++
Cheers.
Open Replace with Ctrl+H & tick the Regular Expression box
Find: \{(.*),(.*)\}
Replace With: {\2,\1}
(Assumes no } in the quoted values)
in notepad++ :
find :
\{\s*\"(.*?)\"s*\,\s*\"(.*?)\"\s*}
replace by :
{"\2","\1"}
Try this one:
Search: (\{\s*")([^"}]*)(",\s*")([^"}]*)("\})
Replace: \1\4\3\2\5
Pattern: \{("[^"]*")\s*,\s*("[^"]*")\}
Replacement: {$2,$1}
Explanation:
group the "..." parts
use the inverse character class [^"]* to match everything until the first "
reverse their orders with the backreferences: {$2,$1}

Replace string with modified string

I have a file with 1000's of rows looking like
"20140611","20:19","C","IT","IT","HDR","HDPDIT","675605","000000135.97"," ..........
I am trying to replace all occurrences of string that matches this pattern :
quote then 6 numerics followed by a closing quote ( i.e. "675605" with "675605#")
Using edit plus regular expression search and replace, the search string is :
\"[0-9][0-9][0-9][0-9][0-9][0-9]\"
This will find all the occurrences I need
However I'm unable construct the correct replace with reg ex to replace the match with itself followed by the # sign e.g. "675605#
With sed you can have:
sed -r 's|"([0-9]{6})"|"\1#"|g' file
Add -i to modify it inline.
So my proposed regex - replacement form is:
"([0-9]{6})" - "\1#"
Quoted:
\"([0-9]{6})\" - \"\\1#\"
Regex:
\"([0-9][0-9][0-9][0-9][0-9][0-9])\"
Replacement string:
"\1#
DEMO
Replacement string would be "\1" if you want "675605#"
You need to use capturing groups. I don't know if you can use them in Edit Plus, but I think it should work:
Find what: \"(\d{6})\"
Replace with: \"\1#\"
Where \1 is a number captured in parenthesis.
Open your file in vim or vi editor using below command:
vi "filename"
then use this command it replace your "675605" pattern with "675605#"
:%s/675605/675605#/g
then
esc :wq
now you open your file it replaced all your "675605" pattern with "675605#".

RegEx find & replace adding numbers infront of numbers leaving numbers as it is

I have this:
1200
3701
Trying to get this:
100ct1200
100ct3701
But got this:
100ct([0-9])([0-9])([0-9])([0-9])
Because I used regex in find & replace:
Find: ([0-9])([0-9])([0-9])([0-9])
Replace: 100ct([0-9])([0-9])([0-9])([0-9])
Actually I don't know how to express it to just add 100ct infront of the numbers and leave the rest as-it-is. Help? Thanks!
You need to use the following syntax
Find: (([0-9])([0-9])([0-9])([0-9]))
Replace: 100ct\1
Note the parentheses around the whole find expression: \1 refers to their content.
EDIT:
You can also use some shorthands for the Find expression:
Find: (\d{4})
It means "match 4 digits".
Your find and replace commands should be,
Find: ([0-9][0-9][0-9][0-9])
Replace: 100ct$1
$1 or \1 or #1 according to your tool.
Find: ([0-9][0-9][0-9][0-9])
Replace: 100ct$1 or 100ct\1 depending on the language (not sure what syntax Notepad++ uses).
Demo: http://regex101.com/r/cT1mJ8/1