Examples of using Subpattern in English and their translations into Hindi
{-}
-
Colloquial
-
Ecclesiastic
-
Ecclesiastic
-
Computer
Defining subpatterns for use by reference.
The maximum number of capturing subpatterns is 65535.
Assertion subpatterns are not capturing subpatterns.
To help with this difficulty, PCRE supports the naming of subpatterns.
In PCRE, a subpattern can be named in one of three ways:(?…)?
Atomic groups in general can contain any complicated subpatterns, and can be nested.
If there is more than one subpattern with the same name, the earliest one is used.
A subpattern that is referenced by name can appear in the pattern before or after the reference.
If there is no such group within the subpattern,(*THEN) causes the subroutine match to fail.
If a subpattern has not been used in a particular match, any back references to it always fails.
The condition istrue if the most recent recursion is into the subpattern whose number or name is given.
But as the subpattern is named, we can also give its name in the value list:.
The numbers of any capturing parentheses that follow the subpattern start after the highest number used in any branch.
If a subpattern has not actually been used in a particular match, any back references to it always fail by default.
(An alternative way ofsolving this problem is to use a"branch reset" subpattern, as described in the previous section.).
In general, subpatterns that got assigned no value in the match are returned as the tuple{-1,0} when type is index.
If the condition is the string(DEFINE), and there is no subpattern with the name DEFINE, the condition is always false.
In Perl, when a subpattern is called recursively or as a subpattern(see the next section), it has no access to any values that were captured outside the recursion.
Each of the two alternatives can itself contain nested subpatterns of any form, including conditional subpatterns;
However, when it is inside a subpattern that is called as a subroutine, only that subpattern is ended successfully.
Atomic grouping(a term taken from Jeffrey Friedl's book)provides the means for specifying that once a subpattern has matched, it is not to be re-evaluated in this way.
An option change within a subpattern(see section Subpatterns) affects only that part of the subpattern that follows it.
The sequence\g{-1}is a reference to the most recently started capturing subpattern before\g, that is, is it equivalent to \2 in this example.
If the alternatives are within a subpattern(defined below),"succeeds" means matching the rest of the mainpattern as well as the alternative in the subpattern.
You cannot use different names to distinguish between two subpatterns with the same number because PCRE uses only the numbers when matching.
If the alternatives are within a subpattern(defined in section Subpatterns),"succeeds" means matching the remaining main pattern and the alternative in the subpattern.
(Duplicate names are also always permitted for subpatterns with the same number, set up as described in the previous section.).
If the condition is the string(R), and there is no subpattern with the name R, the condition is true if a recursive call to the whole pattern or any subpattern has been made.
Processing options such as case-independence are fixed when a subpattern is defined, so if it is used as a subroutine, such options cannot be changed for different calls.