Link to home
Start Free TrialLog in
Avatar of ST3VO
ST3VOFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Search and Replace question

Hi all,

I have a few tags I want to search for and replace with something else.
Here is an example:

I have this:
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>

so ....

I Search for:
<meta content=

and if found delete the whole line from <META content=  to the ending >

and replace with something else.

Hope you can help

thx

st3vo


Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

same problem as before, you do a special function like in the previous post using Pos, PosEx, Copy, retaining some key positions in your algo, or you use the RegExpr component with the "regular expression of the death" and you solve your problem.
Avatar of ST3VO

ASKER

Again, whatever solves my problem, I'm happy with!

thx

ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ST3VO

ASKER

Got 2 errors in the code

[DCC Error] Unit1.pas(184): E2003 Undeclared identifier: 'PosEx'

and

[DCC Error] Unit1.pas(189): E2003 Undeclared identifier: 'LeftStr'

Do I need to add somethhing else?

thx
Avatar of ST3VO

ASKER

OK, I got if to compile but it doesn't work. Also...the function wants to search and delete ... I need it to add some other code in it's place.

thx again

Avatar of ST3VO

ASKER

Sorted! thanks :o)
@epasquier

"some key positions in your algo, or you use the RegExpr component with the "regular expression of the death" and you solve your problem."

I find it really hard to match your attitude and the fact you complain about people reacting negative on your posts.
MerjinB :
1) I take a little humour is not authorized as far as you are concerned ? Are Regular Expressions not some very difficult things to grasp, better left for seasoned programmers ? It's hardly readable and the fact is that st3vo has posted about 5 times an analogous question, with some little variations. So either he did not had time to see RegExpr documentation and prefer having his food cooked, or he will never read it. The same could apply to the fact that he could have made some modifications of the provided functions using PoxEx & Copy, and I have tried to push him this way because that is the quickest way for him to become able to find his own solutions.

2) I really don't see why you are talking about attitude where my only complaining was in my opinion well deserved and Geert finally did not took it as hard as you. Please stop adding oil to an extinguished fire.