What are Capturing Groups in regular expressions?

preview_player
Показать описание
Capturing Groups:-
Using parentheses, you can create groups of characters: (...).Regular expressions has the ability to capture parts of a string, and put them into an array. You can do so using Groups, and in particular Capturing Groups. By default, a Group is a Capturing Group.

They are exactly the same, and return an Array with the whole matched string in the first item, then each matched group content. If there is no match, it returns null.

Reference matched groups:-
Every group that’s matched is assigned a number. $1 refers to the first, $2 to the second, and so on. This will be useful when replacing parts of a string.

We are a premier Performance Marketing & Analytics Consulting firm where we provide customized solutions for Ecommerce clients to improve their data collection and measurement strategies.


#MakeMarketer​​​ #MeasureMarkete
Рекомендации по теме
Комментарии
Автор

the best ever video i have seen regarding capture groups1 Thankss bro!

yashobantadash
Автор

Always providing value bombs, keep up the great works. best place to learn Measure Marketing Skills.

Zulfibf
Автор

The issue that you're seeing is that he was trying to differentiate the 4 items in the phone number example but 1 & 3, and 2 & 4 were identical (hence the look of consternation). What he probably wanted to use as an example set was :

123.123.1234
123-123-1234
(123).123.1234
(123)-123-1234

the_underscore
Автор

Prashant Joel reniguntala.. I want to capture group in such a way that it should not match Joel. How to write

youtubealiens
Автор

will be retrieved
what you will do with that value? Please give some use-case.

vb