AS3 Code:
var str = "";
var reg =/(\d{}) \/gx;
\ is a reverse grouping that represents the same matching result character as the previous group. such as \d{} match, then \ can only be matched,
var first=str.match (reg);
Match (), returns an object, if Reg has global attribute G, the object's numeric index is the exact match character,
//If there is no global attribute G, the index is the first exact match character, and the other indexes are matched characters for each group for
{
Trace (first property name: "+key +", Value: "+ First[key])
}/
*
output
First property name:, Value:
First property name:, Value:
*/
JS Code
<script language= "JavaScript" >
var str = "";
var reg =/(\d{}) \/gx;
\ is a reverse grouping that represents the same matching result character as the previous group. such as \d{} match, then \ can only be matched,
var first=str.match (reg);
Match (), returns an object, if Reg has global attribute G, the object's numeric index is the exact match character,
//If there is no global attribute G, the index is the first exact match character, and the other indexes are matched characters for each group in order
(Var key in First)
{
document.write ("+key +", Value: "+ First[key]")
}
</script>
<!--
output.
First property name:, Value:
First property name:, Value:
More complex reverse references:
Here is a simple keyword search highlighting regular expression usage.
AS3
var str = "";
var reg =/(\d{}) \/gx;
var first=str.replace (Reg, "<font color=red>$$</font>");
Output <font Color=red>$</font><font color=red>$</font>. The
//replace () function is to replace the matching string with the corresponding field.
//Note the $ reverse represents the group \d{} in the first bracket of Reg, and the $ is shown directly, indicating that the regular expression only recognizes parentheses as grouping and does not recognize/identify as the second group
Js
<script language= "JavaScript" >
var str = "";
var reg =/(\d{}) \/gx;
var first=str.replace (Reg, "<font color=red>$$</font>");
Output <font Color=red>$</font><font color=red>$</font>. The
//replace () function is to replace the matching string with the corresponding field.
//Note the $ reverse represents the group \d{} in the first bracket of Reg, and the $ is shown directly, indicating that the regular expression only recognizes parentheses as a grouping and does not recognize/identify as the second grouping
document.write (a);
The above content is small to introduce the AS3 JS regular expression of the reverse reference (backreference), I hope to help you!