Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > case INsensitive regular expressions

Reply
Thread Tools

case INsensitive regular expressions

 
 
sabinosa
Guest
Posts: n/a
 
      10-21-2004
Hi everyone,
I am working with a RegularExpressionValidator in Visual Studio.NET.
I would like to define a custom regular expression that ignores the
letter case and therefore is case INsensitive. I have seen that the
syntax might be something like "(?i)" or "/i". However, when I try to
use that as part of my regular expression (ex. (?i)^(CSV|ZIP|TXT)$)
the result is a javascript error. The error says: "Syntax error in
regular expression"
(^(CSV|ZIP|TXT)$/i does not work)

Any idea what I am doing wrong? Thanks in advance for your responses!
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      10-21-2004

[ Followups set ]


sabinosa <(E-Mail Removed)> wrote:

> I am working with a RegularExpressionValidator in Visual Studio.NET.


> Any idea what I am doing wrong?



Posting a question that is not related to Perl into the Perl newsgroup.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      10-22-2004

"Jürgen Exner" <(E-Mail Removed)> wrote in message
news:nT1ed.12744$n81.3370@trnddc08...
> sabinosa wrote:
>> I am working with a RegularExpressionValidator in Visual Studio.NET.

>
> Interesting! I didn't know that Visual Studio.NET supports Perl. I guess
> there is always something new to learn.
>


It's not nearly as impressive as it might sound. I would go with C# if you
have to go the MS application/aspx route (although I only used the Perl
extension for a while under the trial license). The only advantage I've
found to .Net is that it makes other languages more Perlish (although still
in a cramped and painful way), but it just gets in the way of Perl (i.e.,
why go through all the building, matching and capturing involved in using
the RegularExpressions class when Perl makes it so ridiculously easy). If
you really need Perl in an ASPX environment, though, I guess there's no
other option...

>
>> The error says: "Syntax error in
>> regular expression"
>> (^(CSV|ZIP|TXT)$/i does not work)

>
> At least the trailing /i is the correct syntax.


In Perl, yes. In .Net, probably not. .Net has an ugly, verbose way of OR'ing
modifiers. For example:

Regex myPattern = new Regex(@"^(CSV|ZIP|TXT)$", RegexOptions.Multiline |
RegexOptions.IgnoreCase);

But then again, this is really getting off-topic for this group...

Matt


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check file exists with case sensitive on a case insensitive filesystem Xah Lee Perl Misc 4 04-05-2009 11:21 PM
case insensitive find on case sensitive stl map benhoefer@gmail.com C++ 1 04-06-2007 08:42 PM
regular expression for case insensitive USA state codes Stan ASP .Net 1 05-16-2006 08:27 PM
case INsensitive regular expressions sabinosa ASP .Net Web Controls 3 10-22-2004 08:47 AM
how to case select with case-insensitive string ? Tee ASP .Net 3 06-23-2004 07:40 PM



Advertisments