I found a good regular expression created by Russell Libby (rlibby):
http://www.experts-exchang
But I don't know how to use it. Do you know?
PS: dougaug, your solution is quite interesting, I will try tomorrow.
Main Topics
Browse All TopicsHi,
I need a function to search string using pattern.
InputString := '<b><font><script>Write("N
Pattern := '<font><script>Write("NAME
value := GetValue(InputString, Pattern);
Then the result, variable "value" have string 'APPLE'.
Of course the InputString and Pattern will be different on other situation.
Anyone can help me to create the function GetValue() ?
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I found a good regular expression created by Russell Libby (rlibby):
http://www.experts-exchang
But I don't know how to use it. Do you know?
PS: dougaug, your solution is quite interesting, I will try tomorrow.
I've tried to use the regular expression library you've posted above, but I didn't understand some of its features. For example, the following code raises an exception (which I've supposed it must match):
with TRegExpr.Create do
begin
Source := '<b><font><script>Write("NAME")</
Pattern := '.*<font><script>Write("NAME")
if MatchFirst then
showmessage('matched');
end;
Maybe if rlibby will be listening us, he can help us...
Regards
Hi dougaug,
From the source code, it said:
// Please note the following special characters, that MUST be escaped if they
// are meant to match a literal character:
//
// $ ! ( , ) | ^ * ? + - @ [ ] . { } :
I changed the pattern to Pattern := '\.\*<font><script>Write("NAME
But no match.
I found a better regex for delphi:
http://regexpstudio.com/TR
it works like below in the code, but I dont know how to extract the APPLE word.
Business Accounts
Answer for Membership
by: dougaugPosted on 2009-08-11 at 09:07:19ID: 25070574
Hi,
I've written the function below that solves your problem, but I suggest you find in Internet some Delphi Library about Regular Expressions that provides you a more flexible solution.
Select allOpen in new window