.NETGURU
Any ideas on this RegExp?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Dwight H. Barbour (VIP)
Is there anything in RegExp that would work for the following?
=20
Want to let everything pass thru, EXCEPT the word JAVA (no need to be
careful regarding case sensitivity).=20
=20
The RegExp should *NOT match* the following: (it's important that ONLY
this one *NOT match*)
The language is: JAVA
=20
The RegExp should *match* the following:
The language is: C
The language is: VB.NET
The language is: Pascal
The language is: COBOL
=20
The RegExp should *match* potential new languages such as:
The language is: JAVA1
The language is: myJAVA
The language is:=20
The language is:=20
=20
I hope this makes sense. I'm not actually working on an asp.net
project, but am working on the Lyris listserve software for
aspfriends.com.
=20
Thanks.
Dwight.
=20

Reply to this message...
 
    
Scott Mitchell (VIP)
Why in the world would you use a RegExp to do this? Just use InStr (or
the .NET equivlatnet, IndexOf) and search for JAVA. Wouldn't this be
much simpler than using a regexp?

Scott Mitchell
Click here to reveal e-mail address

***********************************************************

Looking for an on-line forum application to use in your ASP.NET Web
site? Your search is over! Download WebForums.NET today, the *first*
ASP.NET on-line forum system:
http://www.WebForumsSoftware.net/

********************************************

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| Sent: Sunday, January 06, 2002 9:51 PM
| To: aspngregexp
| Subject: [aspngregexp] Any ideas on this RegExp?
|
|
| Is there anything in RegExp that would work for the following?
|
| Want to let everything pass thru, EXCEPT the word JAVA (no need to be
| careful regarding case sensitivity).
|
| The RegExp should *NOT match* the following: (it's important
| that ONLY
| this one *NOT match*)
| The language is: JAVA
|
| The RegExp should *match* the following:
| The language is: C
| The language is: VB.NET
| The language is: Pascal
| The language is: COBOL
|
| The RegExp should *match* potential new languages such as:
| The language is: JAVA1
| The language is: myJAVA
| The language is:
| The language is:
|
| I hope this makes sense. I'm not actually working on an asp.net
| project, but am working on the Lyris listserve software for
| aspfriends.com.
|
| Thanks.
| Dwight.
|
|
| | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | http://www.asplists.com/search = SEARCH Archives
|
|

Reply to this message...
 
    
Dwight H. Barbour (VIP)

Scott, I agree with you! =20

However, this isn't a program I'm writing, just need a little help with
writing a RegExp.

The interface accepts two types of input:

1. exact text match (=3D)
2. regular expression

Dwight.

-----Original Message-----
From: Scott Mitchell [mailto:Click here to reveal e-mail address]
Sent: Monday, January 07, 2002 1:53 AM
To: aspngregexp
Subject: [aspngregexp] RE: Any ideas on this RegExp?

Why in the world would you use a RegExp to do this? Just use InStr (or
the .NET equivlatnet, IndexOf) and search for JAVA. Wouldn't this be
much simpler than using a regexp?

Scott Mitchell
Click here to reveal e-mail address

***********************************************************

Looking for an on-line forum application to use in your ASP.NET Web
site? Your search is over! Download WebForums.NET today, the *first*
ASP.NET on-line forum system:
http://www.WebForumsSoftware.net/

********************************************

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| Sent: Sunday, January 06, 2002 9:51 PM
| To: aspngregexp
| Subject: [aspngregexp] Any ideas on this RegExp?
|
|
| Is there anything in RegExp that would work for the following?
|
| Want to let everything pass thru, EXCEPT the word JAVA (no need to be
| careful regarding case sensitivity).
|
| The RegExp should *NOT match* the following: (it's important
| that ONLY
| this one *NOT match*)
| The language is: JAVA
|
| The RegExp should *match* the following:
| The language is: C
| The language is: VB.NET
| The language is: Pascal
| The language is: COBOL
|
| The RegExp should *match* potential new languages such as:
| The language is: JAVA1
| The language is: myJAVA
| The language is:
| The language is:
|
| I hope this makes sense. I'm not actually working on an asp.net
| project, but am working on the Lyris listserve software for
| aspfriends.com.
|
| Thanks.
| Dwight.
|
|
| | [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| | http://www.asplists.com/search =3D SEARCH Archives
|
|

| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Scott Mitchell (VIP)
I don't know of a way to say: "Don't match this pattern." I know how to
instruct a regexp not to match certain characters or character ranges -
[^a-z], for example, will match strings NOT containing characters a to
z.

You may be up sh!t creek here. Hrmmm... maybe not. I guess this might
work:

^[^j][^a][^v][^a]$

totally untested, but it just may work, although, to be honest, I
wouldn't be surprised if it didn't! :)

Scott Mitchell
Click here to reveal e-mail address
http://www.4GuysFromRolla.com/
http://www.ASPMessageboard.com/
http://www.ASPFAQs.com/

* When you think ASP, think 4GuysFromRolla.com!

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| Sent: Sunday, January 06, 2002 11:00 PM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
|
| Scott, I agree with you!
|
| However, this isn't a program I'm writing, just need a little
| help with
| writing a RegExp.
|
| The interface accepts two types of input:
|
| 1. exact text match (=)
| 2. regular expression
|
| Dwight.
|
| -----Original Message-----
| From: Scott Mitchell [mailto:Click here to reveal e-mail address]
| Sent: Monday, January 07, 2002 1:53 AM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
| Why in the world would you use a RegExp to do this? Just use
| InStr (or
| the .NET equivlatnet, IndexOf) and search for JAVA. Wouldn't this be
| much simpler than using a regexp?
|
| Scott Mitchell
| Click here to reveal e-mail address
|
|
| ***********************************************************
|
| Looking for an on-line forum application to use in your ASP.NET Web
| site? Your search is over! Download WebForums.NET today, the *first*
| ASP.NET on-line forum system:
| http://www.WebForumsSoftware.net/
|
| ********************************************
|
| | -----Original Message-----
| | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| | Sent: Sunday, January 06, 2002 9:51 PM
| | To: aspngregexp
| | Subject: [aspngregexp] Any ideas on this RegExp?
| |
| |
| | Is there anything in RegExp that would work for the following?
| |
| | Want to let everything pass thru, EXCEPT the word JAVA (no
| need to be
| | careful regarding case sensitivity).
| |
| | The RegExp should *NOT match* the following: (it's important
| | that ONLY
| | this one *NOT match*)
| | The language is: JAVA
| |
| | The RegExp should *match* the following:
| | The language is: C
| | The language is: VB.NET
| | The language is: Pascal
| | The language is: COBOL
| |
| | The RegExp should *match* potential new languages such as:
| | The language is: JAVA1
| | The language is: myJAVA
| | The language is:
| | The language is:
| |
| | I hope this makes sense. I'm not actually working on an asp.net
| | project, but am working on the Lyris listserve software for
| | aspfriends.com.
| |
| | Thanks.
| | Dwight.
| |
| |
| | | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | | http://www.asplists.com/search = SEARCH Archives
| |
| |
|
|
| | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | http://www.asplists.com/search = SEARCH Archives
|
|
| | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | http://www.asplists.com/search = SEARCH Archives
|
|

Reply to this message...
 
    
Dwight H. Barbour (VIP)

That's what i've been working with [^j]. Had hopped for a better
solution. Maybe someone else on the list will have some ideas.

This thinking in reverse logic isn't the easiest.

No sh!t creek here.. there will be a solution!

Thanks.
Dwight.

-----Original Message-----
From: Scott Mitchell [mailto:Click here to reveal e-mail address]
Sent: Monday, January 07, 2002 2:58 AM
To: aspngregexp
Subject: [aspngregexp] RE: Any ideas on this RegExp?

I don't know of a way to say: "Don't match this pattern." I know how to
instruct a regexp not to match certain characters or character ranges -
[^a-z], for example, will match strings NOT containing characters a to
z.

You may be up sh!t creek here. Hrmmm... maybe not. I guess this might
work:

^[^j][^a][^v][^a]$

totally untested, but it just may work, although, to be honest, I
wouldn't be surprised if it didn't! :)

Scott Mitchell
Click here to reveal e-mail address
http://www.4GuysFromRolla.com/
http://www.ASPMessageboard.com/
http://www.ASPFAQs.com/

* When you think ASP, think 4GuysFromRolla.com!

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| Sent: Sunday, January 06, 2002 11:00 PM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
|
| Scott, I agree with you!
|
| However, this isn't a program I'm writing, just need a little
| help with
| writing a RegExp.
|
| The interface accepts two types of input:
|
| 1. exact text match (=3D)
| 2. regular expression
|
| Dwight.
|
| -----Original Message-----
| From: Scott Mitchell [mailto:Click here to reveal e-mail address]
| Sent: Monday, January 07, 2002 1:53 AM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
| Why in the world would you use a RegExp to do this? Just use
| InStr (or
| the .NET equivlatnet, IndexOf) and search for JAVA. Wouldn't this be
| much simpler than using a regexp?
|
| Scott Mitchell
| Click here to reveal e-mail address
|
|
| ***********************************************************
|
| Looking for an on-line forum application to use in your ASP.NET Web
| site? Your search is over! Download WebForums.NET today, the *first*
| ASP.NET on-line forum system:
| http://www.WebForumsSoftware.net/
|
| ********************************************
|
| | -----Original Message-----
| | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| | Sent: Sunday, January 06, 2002 9:51 PM
| | To: aspngregexp
| | Subject: [aspngregexp] Any ideas on this RegExp?
| |
| |
| | Is there anything in RegExp that would work for the following?
| |
| | Want to let everything pass thru, EXCEPT the word JAVA (no
| need to be
| | careful regarding case sensitivity).
| |
| | The RegExp should *NOT match* the following: (it's important
| | that ONLY
| | this one *NOT match*)
| | The language is: JAVA
| |
| | The RegExp should *match* the following:
| | The language is: C
| | The language is: VB.NET
| | The language is: Pascal
| | The language is: COBOL
| |
| | The RegExp should *match* potential new languages such as:
| | The language is: JAVA1
| | The language is: myJAVA
| | The language is:
| | The language is:
| |
| | I hope this makes sense. I'm not actually working on an asp.net
| | project, but am working on the Lyris listserve software for
| | aspfriends.com.
| |
| | Thanks.
| | Dwight.
| |
| |
| | | [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| | | http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| | | http://www.asplists.com/search =3D SEARCH Archives
| |
| |
|
|
| | [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| | http://www.asplists.com/search =3D SEARCH Archives
|
|
| | [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| | http://www.asplists.com/search =3D SEARCH Archives
|
|

| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Scott Mitchell (VIP)
The proposed regexp I provided didn't work?

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| Sent: Monday, January 07, 2002 12:07 AM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
|
| That's what i've been working with [^j]. Had hopped for a better
| solution. Maybe someone else on the list will have some ideas.
|
| This thinking in reverse logic isn't the easiest.
|
| No sh!t creek here.. there will be a solution!
|
| Thanks.
| Dwight.
|
|
| -----Original Message-----
| From: Scott Mitchell [mailto:Click here to reveal e-mail address]
| Sent: Monday, January 07, 2002 2:58 AM
| To: aspngregexp
| Subject: [aspngregexp] RE: Any ideas on this RegExp?
|
|
| I don't know of a way to say: "Don't match this pattern." I
| know how to
| instruct a regexp not to match certain characters or
| character ranges -
| [^a-z], for example, will match strings NOT containing characters a to
| z.
|
| You may be up sh!t creek here. Hrmmm... maybe not. I guess
| this might
| work:
|
| ^[^j][^a][^v][^a]$
|
| totally untested, but it just may work, although, to be honest, I
| wouldn't be surprised if it didn't! :)
|
| Scott Mitchell
| Click here to reveal e-mail address
| http://www.4GuysFromRolla.com/
| http://www.ASPMessageboard.com/
| http://www.ASPFAQs.com/
|
| * When you think ASP, think 4GuysFromRolla.com!
|
|
| | -----Original Message-----
| | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| | Sent: Sunday, January 06, 2002 11:00 PM
| | To: aspngregexp
| | Subject: [aspngregexp] RE: Any ideas on this RegExp?
| |
| |
| |
| | Scott, I agree with you!
| |
| | However, this isn't a program I'm writing, just need a little
| | help with
| | writing a RegExp.
| |
| | The interface accepts two types of input:
| |
| | 1. exact text match (=)
| | 2. regular expression
| |
| | Dwight.
| |
| | -----Original Message-----
| | From: Scott Mitchell [mailto:Click here to reveal e-mail address]
| | Sent: Monday, January 07, 2002 1:53 AM
| | To: aspngregexp
| | Subject: [aspngregexp] RE: Any ideas on this RegExp?
| |
| |
| | Why in the world would you use a RegExp to do this? Just use
| | InStr (or
| | the .NET equivlatnet, IndexOf) and search for JAVA.
| Wouldn't this be
| | much simpler than using a regexp?
| |
| | Scott Mitchell
| | Click here to reveal e-mail address
| |
| |
| | ***********************************************************
| |
| | Looking for an on-line forum application to use in your ASP.NET Web
| | site? Your search is over! Download WebForums.NET today,
| the *first*
| | ASP.NET on-line forum system:
| | http://www.WebForumsSoftware.net/
| |
| | ********************************************
| |
| | | -----Original Message-----
| | | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| | | Sent: Sunday, January 06, 2002 9:51 PM
| | | To: aspngregexp
| | | Subject: [aspngregexp] Any ideas on this RegExp?
| | |
| | |
| | | Is there anything in RegExp that would work for the following?
| | |
| | | Want to let everything pass thru, EXCEPT the word JAVA (no
| | need to be
| | | careful regarding case sensitivity).
| | |
| | | The RegExp should *NOT match* the following: (it's important
| | | that ONLY
| | | this one *NOT match*)
| | | The language is: JAVA
| | |
| | | The RegExp should *match* the following:
| | | The language is: C
| | | The language is: VB.NET
| | | The language is: Pascal
| | | The language is: COBOL
| | |
| | | The RegExp should *match* potential new languages such as:
| | | The language is: JAVA1
| | | The language is: myJAVA
| | | The language is:
| | | The language is:
| | |
| | | I hope this makes sense. I'm not actually working on an asp.net
| | | project, but am working on the Lyris listserve software for
| | | aspfriends.com.
| | |
| | | Thanks.
| | | Dwight.
| | |
| | |
| | | | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | | | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | | | http://www.asplists.com/search = SEARCH Archives
| | |
| | |
| |
| |
| | | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | | http://www.asplists.com/search = SEARCH Archives
| |
| |
| | | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | | http://www.asplists.com/search = SEARCH Archives
| |
| |
|
|
| | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | http://www.asplists.com/search = SEARCH Archives
|
|
| | [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| | http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| | http://www.asplists.com/search = SEARCH Archives
|

Reply to this message...
 
    
Ryan Trudelle-Schwarz (VIP)
Ok, so what's the prize for getting it? ;)

Check the following:
@"\A(?!java\z).*?"

Results:
Testing "java": False
Testing "CSharp": True
Testing "javascript": True
Testing "myJava": True
Testing "Pascal": True
Testing "VB.Net": True
Testing "C": True

:)

hth, Ryan

-----Original Message-----
From: Scott Mitchell [mailto:Click here to reveal e-mail address]

The proposed regexp I provided didn't work?

| -----Original Message-----
| From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
|
| That's what i've been working with [^j]. Had hopped for a better
| solution. Maybe someone else on the list will have some ideas.
|
| This thinking in reverse logic isn't the easiest.
|
| No sh!t creek here.. there will be a solution!
|
| Thanks.
| Dwight.
|
|
| -----Original Message-----
| From: Scott Mitchell [mailto:Click here to reveal e-mail address]
|
| I don't know of a way to say: "Don't match this pattern." I
| know how to
| instruct a regexp not to match certain characters or
| character ranges -
| [^a-z], for example, will match strings NOT containing characters a to
| z.
|
| You may be up sh!t creek here. Hrmmm... maybe not. I guess
| this might
| work:
|
| ^[^j][^a][^v][^a]$
|
| totally untested, but it just may work, although, to be honest, I
| wouldn't be surprised if it didn't! :)
|
| Scott Mitchell
|
| | -----Original Message-----
| | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| |
| | Scott, I agree with you!
| |
| | However, this isn't a program I'm writing, just need a little
| | help with
| | writing a RegExp.
| |
| | The interface accepts two types of input:
| |
| | 1. exact text match (=)
| | 2. regular expression
| |
| | Dwight.
| |
| | -----Original Message-----
| | From: Scott Mitchell [mailto:Click here to reveal e-mail address]
| |
| | Why in the world would you use a RegExp to do this? Just use
| | InStr (or
| | the .NET equivlatnet, IndexOf) and search for JAVA.
| Wouldn't this be
| | much simpler than using a regexp?
| |
| | Scott Mitchell
| |
| | | -----Original Message-----
| | | From: Dwight H. Barbour [mailto:Click here to reveal e-mail address]
| | |
| | | Is there anything in RegExp that would work for the following?
| | |
| | | Want to let everything pass thru, EXCEPT the word JAVA (no
| | need to be
| | | careful regarding case sensitivity).
| | |
| | | The RegExp should *NOT match* the following: (it's important
| | | that ONLY
| | | this one *NOT match*)
| | | The language is: JAVA
| | |
| | | The RegExp should *match* the following:
| | | The language is: C
| | | The language is: VB.NET
| | | The language is: Pascal
| | | The language is: COBOL
| | |
| | | The RegExp should *match* potential new languages such as:
| | | The language is: JAVA1
| | | The language is: myJAVA
| | | The language is:
| | | The language is:
| | |
| | | I hope this makes sense. I'm not actually working on an asp.net
| | | project, but am working on the Lyris listserve software for
| | | aspfriends.com.
| | |
| | | Thanks.
| | | Dwight.

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification