Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Delete all text EXCEPT...

Avatar of Wayne Barron
Wayne BarronFlag for United States of America asked on
Delphi
3 Comments1 Solution293 ViewsLast Modified:
Hello All;

Button and Memo (That is all that is needed in this project)

OK.
Load the following into a Memo1



something here (12HG)
because we (4R5Y)
need it (6HY9)

I need to first
Loop through and delete all text that is not in the parentheses
Then after that
Loop through and delete all the parentheses ( & )
So that the only thing that is left is the items within the parentheses.

That should be a simple one, but I cannot seem to get the code that I have to work.
Supplied below.
Which I was trying to get to look at the ( and delete everything else.
Which will work if you put in    http://
But not    (

Thanks all
Carrzkiss
(I do not have to use this code provided, just should that I am trying myself as well)
procedure TForm1.Button1Click(Sender: TObject);
var Q:Integer;
begin
for Q :=Memo1.Lines.Count -1 downto 0 do
 begin 
if pos( '(', lowercase(Memo1.Lines[Q]) ) = 0 
   then Memo1.Lines.Delete(Q);
 end;
end;
ASKER CERTIFIED SOLUTION
Avatar of Hypo
HypoFlag of Sweden image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers