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:

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
3 Comments1 Solution293 ViewsLast Modified:
Hello All;

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

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
(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;
for Q :=Memo1.Lines.Count -1 downto 0 do
if pos( '(', lowercase(Memo1.Lines[Q]) ) = 0 
   then Memo1.Lines.Delete(Q);
Avatar of Hypo
HypoFlag of Sweden image

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

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