Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello I am a bit stuck on what seems like a simple issue but for some reason I am not able to figure out how its possible to only return one number by itself on the last line of text because other numbers also exist in the string that match the expression


CSS
C:\Users\Admin\Desktop\folderCore\bin\Debug>folder\test.exe "C:\$Recycle.Bin\S-1-5-21-2170344938-3844411135-1366276297-1001\$R7D4RT0.exe"
dumping of C:\$Recycle.Bin\S-1-5-21-2170344938-3844411135-1366276297-1001\$R7D4RT0.exe
DebugSize:  0
ImageVersion:   0
IatRVA:     40740
ExportSize: 0
ResourceSize:   4696
VirtualSize2:   15094
NumberOfSections:4
Stop
1



In this PE dump I am trying to only match the last line but there is no way that i can see to weed out the other matches

thank you in advance for your help
Posted
Updated 14-Jan-14 9:22am
v2
Comments
Kornfeld Eliyahu Peter 14-Jan-14 14:53pm    
Can you show your regex?
Sergey Alexandrovich Kryukov 14-Jan-14 14:57pm    
Regex is pretty much useless here — please see my answer.
—SA
Kornfeld Eliyahu Peter 14-Jan-14 15:05pm    
As I understood he has a dump, and he tries to find some part using regex...
Sergey Alexandrovich Kryukov 14-Jan-14 15:58pm    
Ah, maybe you are right, but then he should have explained that...
—SA

1 solution

(?i)\b\d+$ seems to work on the provided text.


Oh, and you'll likely need to redirect or pipe the text. (Maybe you already are, but you don't show it.)
 
Share this answer
 
v2
Comments
Maciej Los 15-Jan-14 2:00am    
+5
Member 10566155 2-Feb-14 16:08pm    
can I have the code and test.exe? I need it for malware detection. please mail me: shakibstu@hotmail.com

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900