crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Some basic topics and tips for Regex
Question Posted on 03 Feb 2019Home >> 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



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




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?






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap