Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 
Christmas Hanging


Some basic topics and tips for Regex
Question Posted on 03 Feb 2019

Home >> WEB >> Regex Questions >> Some basic topics and tips for Regex




Below are the basic topics and tips for Regex with examples
(1)^The- Its matches and string that starts with the
Example:- The crackyourinterview sites has regex values

(2)End$- Its matches a string that ends with world End
Example:- this is now end

(3)^The End$-Its matches a string that start with "The" and end with "End"
Example:- The data in crackyourinterview has End

(4)data- Its matches the world given
Example:- Crackyourinterview have data in it

Quantifiers?—?* + ? and {}

(5)abc*- Its matches string that has ab followed by zero or more c
Example:- ab,abc,abcc,abccc

(6)abc+- Its matches string that has ab followed by 1 or more c
Example:- abc,abcc,abcc

(7)abc?- Its matches string that has ab followed by zero or one c
Example:- ab,abc

(8)abc{2}- Its matches string that has ab followed by two c
Example:-abcc

(9)abc{2,}- Its matches string that has ab followed by two or more c
Example:-abcc,abccc

(10)abc{2,5}- Its matches string that has ab followed by two upto 5 c
Example:-abcc,abccc,abccccc

(11)a(bc)*- Its matches string that has followed by zero or more copies of sequence bc
Example:-abcbc,abcbcbc

(12)a(bc){2,5}- Its matches string that has followed by zero or more copies of sequence bc from 2 to 5 times
Example:-abcbc,abcbcbc,abcbcbcbc

OR operator?—?| or []

(13)a(b|c)- Its matches string that has followed by b or c
Example:- ab,ac

(14)a[bc]- Its matches string that has followed by b or c
Example:- ab,ac

Character classes?—?\d \w \s and .

(15)\d- Its matches a single character that is a digit
Example:- one1data,keepit1data,key2234

(16)\w- Its matches alphanumeric character plus underscore
Example:-crack_yourinterview

(17)\s- Its matches whitespace character(includes tabs and line breaks)
Example:- , ,

(18). - Its matches any character
Example:- a,cd,csd,fdf

\d, \w and \s also present their negations with \D, \W and \S respectively
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Different regular expression flavors
Some basic topics and tips for Regex
Write down regex which will find img tags is unclosed or not with REGEX?






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |