IT Community - Software Programming, Web Development and Technical Support

Regular expression tips & tricks

This is a discussion on Regular expression tips & tricks within the Database Support forums, part of the Web Development category; Hi pals, Here,i share regular expression tips&tricks,it is more usefult to u REGULAR EXPRESSION Character|Description|...


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

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-10-2007, 12:24 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Regular expression tips & tricks

Hi pals,
Here,i share regular expression tips&tricks,it is more usefult to u


REGULAR EXPRESSION

Character|Description|Example

^(Cap)-Match the beginning of the string-SELECT 'fofo' REGEXP '^fo';


Thanks,
Prasath.K

Last edited by prasath : 09-23-2007 at 10:44 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-14-2007, 03:29 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: Regular experssion tips & tricks

ASP.NET provides a suite of validation controls, which make validating inputs on web forms extremely easy compared to the same task using legacy (or classic if you prefer) ASP. One of the more powerful validators is the RegularExpressionValidator which, as you might guess, allows you to validate inputs by providing a regular expression which must match the input. The regular expression pattern is specified by setting the ValidationExpression property of the control. An example validator


Code:
<asp:RegularExpressionValidator runat="server" id="ZipCodeValidator" 
ControlToValidate="ZipCodeTextBox" ErrorMessage="Invalid ZIP code 
format; format should be either 12345 or 12345-6789."  
ValidationExpression="(\d{5}(-\d{4})?" />
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-18-2007, 10:31 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Re: Regular expression tips & tricks

Hi,
here after,i share another regular expression

REGULAR EXPRESSION
Character Description Example
$(Dollar) Match the end of the string SELECT 'fo\no' REGEXP '^fo\no$';


Thanks,
Prasath.K

Last edited by prasath : 09-23-2007 at 10:45 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-20-2007, 04:47 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Re: Regular expression tips & tricks

Hi,
Here,another regular expression

REGULAR EXPRESSION

.(Dot) Match any character (including carriage return and newline).

Example
SELECT 'fofo' REGEXP '^f.*$';

Last edited by prasath : 09-23-2007 at 10:48 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-21-2007, 12:18 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Re: Regular expression tips & tricks

Hi,
Below explain regular experssion

REGULAR EXPERSSION
a* Match any sequence of zero or more a characters

Example
SELECT 'Ban' REGEXP '^Ba*n';

Last edited by prasath : 09-23-2007 at 10:46 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-21-2007, 10:12 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Smile Re: Regular expression tips & tricks

Hi,
Another regular experssion

REGULAR EXPERSSION
a+ Match any sequence of one or more a characters

Example

SELECT 'Ban' REGEXP '^Ba+n';

Last edited by prasath : 09-23-2007 at 10:43 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-23-2007, 10:05 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Smile Re: Regular expression tips & tricks

hi techies,
here another regular experssion

REGULAR EXPERSSION
a? Match either zero or one a character

Example

SELECT 'Bn' REGEXP '^Ba?n';

Last edited by prasath : 09-23-2007 at 10:41 PM. Reason: spelling mistake
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-24-2007, 10:26 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Re: Regular expression tips & tricks

Hi,
Another regular experssion

de|abc Match either of the sequences de or abc.

Example
SELECT 'pi' REGEXP 'pi|apa';

Thanks,
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-24-2007, 10:55 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default Re: Regular expression tips & tricks

Hi pals,
Another regular expression

(abc)* Match zero or more instances of the sequence abc

Example

SELECT 'pi' REGEXP '^(pi)*$';
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 Sathish Kumar C# Programming 23 09-10-2007 07:00 AM
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 09:10 PM.


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

SEO by vBSEO 3.0.0