473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Regular Expressions IgnoreCase

Hi, I'm using Borland Delphi .NET 2005 and I've got a problem using
Regular Expressions.

But the RegExOptions do not work properly.

My Replace - function looks like:

function TWebForm1.RegExpTags(InputString, Pattern, StringReplacement:
String): String;
var
rx: RegEx;
begin
rx:=RegEx.Create(Pattern, &RegExOptions.IgnoreCase OR
&RegExOptions.Multiline);
RegExpTags:=rx.Replace(InputString, Pattern, StringReplacement);
rx.Free;
end;
My regular expression is:

\[img\]((http|ftp|https|ftps)://)([^
\?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]

I want to use it to replace sub strings like [img]ImageUrl[/img]
So, I call this function as follows:

StrPattern:='\[img\]((http|ftp|https|ftps)://)([^
\?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]';
StrReplace:='<img src="$1$3" border="0">';
OutputString:=RegExpTags(SomeText, StrPattern, StrReplace);
Response.Write(OutputString);
This partly works.
....

...
is being replaced by
<img src="http://www.test.com/test.jpg" border="0">

But Neither
....

...
is not being replaced

Nor
....

...
So why does the RegEx Function not replace the sub strings although the
IgnoreCase property is being set? Do I assign the property not
correctly? Or is there any possibility to set the IgnoreCase properties
in the Regular Expression itself like in Perl with /i/s or #is ? I
already tried it that way but without success.

I hope that someone can help me.

Jan 3 '07 #1
1 1283
<br********@gmx.netwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
Hi, I'm using Borland Delphi .NET 2005
Er, so why are you posting here and not in one of the Borland Delphi
newsgroups...?
Jan 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
0
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
1
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
7
by: oscartheduck | last post by:
Hi folks, I'm trying to alter a program I posted about a few days ago. It creates thumbnail images from master images. Nice and simple. To make sure I can match all variations in spelling of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.