IT Community - Software Programming, Web Development and Technical Support

Regular expression

This is a discussion on Regular expression within the C# Programming forums, part of the Software Development category; Hi Deeban, The Regex class also contains several static methods: Escape: Escapes regex metacharacters within a string IsMatch: Methods return ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #21 (permalink)  
Old 09-10-2007, 06:13 AM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: Regular expression

Hi Deeban,
The Regex class also contains several static methods:

Escape: Escapes regex metacharacters within a string

IsMatch: Methods return a boolean result if the supplied regular expression matches within the string

Match: Methods return Match instance

Matches: Methods return a list of Match as a collection

Replace: Methods that replace the matched regular expressions with replacement strings

Split: Methods return an array of strings determined by the expression

Unescape: Unescapes any escaped characters within a string
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #22 (permalink)  
Old 09-10-2007, 06:38 AM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: Regular expression

Hi deeban,
The Regex class also contains several static methods:

Escape: Escapes regex metacharacters within a string

IsMatch: Methods return a boolean result if the supplied regular expression matches within the string

Match: Methods return Match instance

Matches: Methods return a list of Match as a collection

Replace: Methods that replace the matched regular expressions with replacement strings

Split: Methods return an array of strings determined by the expression

Unescape: Unescapes any escaped characters within a string
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 09-10-2007, 06:47 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Exclamation Re: Regular expression

Hi Sathish,
Can you give me some sample on the Match methods so that it will be easy for me understand?Thanks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 09-10-2007, 07:00 AM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: Regular expression

Hi Deeban,
Here is the sample code for the Match method.

Match m = Regex.Match("abracadabra", "(a|b|r)+");
where "abracadabra" is the string
and (a|b|r)+") is the regular expression
You now have an instance of a Match that can be tested for success, as in:
if (m.Success)
This is how we use the match method.
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is regular expression? saravanan PHP Programming 8 03-28-2008 07:12 AM
How to use Regular expression in Java? S.Vinothkumar Java Programming 3 11-28-2007 09:45 PM
Regular expression tips & tricks prasath Database Support 8 09-24-2007 10:55 PM
Can any one give regular expression for this string? raj PHP Programming 1 07-25-2007 12:42 AM
Regular expression vadivelanvaidyanathan Perl 0 07-15-2007 07:21 PM


All times are GMT -7. The time now is 02:32 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0