Hi guys,
I need to carry out a calculation (an increment operation within a variable) through a regular expression.
That is, everytime, a specific pattern matches, I would like to increment a counter variable.
I am imagining, the code to be something like:
$data=~/<BEGIN_FLAG>/$flag_count++/ ....
So every time the regexp encounters <BEGIN_FLAG>, it increments the $flag_count variable.
Any help would be much appreciated.
Thank you!In reply to Calculations in Regexp by sumeetgrover
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |