Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; check out https://github.com/deseven/pcrefind for more
- #name = "eMailFinder"
- OpenWindow(0,#PB_Ignore,#PB_Ignore,600,400,#name,#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
- DirSelector = ExplorerTreeGadget(#PB_Any,10,10,190,350,"",#PB_Explorer_AlwaysShowSelection|#PB_Explorer_NoFiles|#PB_Explorer_AutoSort)
- FindBtn = ButtonGadget(#PB_Any,10,365,190,25,"Find")
- Results = EditorGadget(#PB_Any,210,10,380,380)
- Dim Results$(0)
- CreateRegularExpression(0,"([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})",#PB_RegularExpression_AnyNewLine)
- Repeat
- ev = WaitWindowEvent()
- If ev = #PB_Event_Gadget And EventGadget() = FindBtn
- If ExamineDirectory(0,GetGadgetText(DirSelector),"*.*")
- ClearGadgetItems(Results)
- SetCurrentDirectory(GetGadgetText(DirSelector))
- While NextDirectoryEntry(0)
- If DirectoryEntryType(0) = #PB_DirectoryEntry_File
- If ReadFile(0,DirectoryEntryName(0),#PB_File_SharedRead)
- While Not Eof(0)
- Found = ExtractRegularExpression(0,ReadString(0),Results$())
- For i = 0 To Found - 1
- AddGadgetItem(Results,-1,"[" + DirectoryEntryName(0) + "] " + Results$(i))
- Next
- ReDim Results$(0)
- Wend
- CloseFile(0)
- EndIf
- EndIf
- Wend
- FinishDirectory(0)
- EndIf
- EndIf
- Until ev = #PB_Event_CloseWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement