#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<=\W)\$[a-zA-Z_\\\{\}= +']+\$"
Local $sString = "We try to quantitatively capture these characteristics by defining a set of indexes, which can be computed using the mosaic image and the corresponding ground truth:" & @CRLF & _
"\begin{itemize}" & @CRLF & _
" \item $\mu_{A_T}$ and $\sigma_{A_T}$, the mean and standard deviation of the tiles area $A_T$, respectively;" & @CRLF & _
" \item $\rho_\text{filler}$, the ratio between the filler area and the overall mosaic are, computed as $\rho_\text{filler}=\frac{\sum_{T \in \mathcal{T} A_T}}{A}$, being $A$ the area of the mosaic;" & @CRLF & _
" \item \todo{does it worth?};" & @CRLF & _
" \item \todo{does it worth?};" & @CRLF & _
" \item $\mu_{C_T}$, the mean of the tiles \emph{color dispersion} $C_T$, being $C_T = \sigma_R+\sigma_G+\sigma_B$, where $\sigma_R$, $\sigma_G$ and $\sigma_B$ are the standard deviation of the red, green and blue channel values of the pixels within the tile $T$." & @CRLF & _
"After applying a method to an image, we compare the segmented image (i.e., the result) against the ground truth and assess the performance according to the following three metrics:" & @CRLF & _
"\begin{itemize}" & @CRLF & _
" \item average tile precision $P$" & @CRLF & _
" \item average tile recall $R$" & @CRLF & _
" \item tile count error $C$" & @CRLF & _
"\end{itemize}" & @CRLF & _
"Let $T$ be a tile on the ground truth $\mathcal{T}$ with area $A_T$." & @CRLF & _
"Let $T'$ be the tile in the segmented image which mostly overlaps $T$ and let $A_{T'}$ be the area of $T$; let $A_{T \cap T'}$ be the overlapping area between $T$ and $T'$." & @CRLF & _
"Let $n$ and $n'$ the number of tiles respectively in the ground truth and in the segmented image." & @CRLF & _
"Metrics are defined as:" & @CRLF & _
"\begin{align}" & @CRLF & _
" P &= \frac{1}{n} \sum_{T \in \mathcal{T}} \frac{A_{T \cap T'}}{A_{T'}} \\" & @CRLF & _
" R &= \frac{1}{n} \sum_{T \in \mathcal{T}} \frac{A_{T \cap T'}}{A_T} \\" & @CRLF & _
" C &= \frac{|n-n'|}{n}" & @CRLF & _
"\end{align}" & @CRLF & _
"We try to quantitatively capture these characteristics by defining a set of indexes, which can be computed using the mosaic image and the corresponding ground truth:" & @CRLF & _
"\begin{itemize}" & @CRLF & _
" \item $\mu_{A_T}$ and $\sigma_{A_T}$, the mean and standard deviation of the tiles area $A_T$, respectively;" & @CRLF & _
" \item $\rho_\text{filler}$, the ratio between the filler area and the overall mosaic are, computed as $\rho_\text{filler}=\frac{\sum_{T \in \mathcal{T} A_T}}{A}$, being $A$ the area of the mosaic;" & @CRLF & _
" \item \todo{does it worth?};" & @CRLF & _
" \item \todo{does it worth?};" & @CRLF & _
" \item $\mu_{C_T}$, the mean of the tiles \emph{color dispersion} $C_T$, being $C_T = \sigma_R+\sigma_G+\sigma_B$, where $\sigma_R$, $\sigma_G$ and $\sigma_B$ are the standard deviation of the red, green and blue channel values of the pixels within the tile $T$." & @CRLF & _
"After applying a method to an image, we compare the segmented image (i.e., the result) against the ground truth and assess the performance according to the following three metrics:" & @CRLF & _
"\begin{itemize}" & @CRLF & _
" \item average tile precision $P$" & @CRLF & _
" \item average tile recall $R$" & @CRLF & _
" \item tile count error $C$" & @CRLF & _
"\end{itemize}" & @CRLF & _
"Let $T$ be a tile on the ground truth $\mathcal{T}$ with area $A_T$." & @CRLF & _
"Let $T'$ be the tile in the segmented image which mostly overlaps $T$ and let $A_{T'}$ be the area of $T$; let $A_{T \cap T'}$ be the overlapping area between $T$ and $T'$." & @CRLF & _
"Let $n$ and $n'$ the number of tiles respectively in the ground truth and in the segmented image." & @CRLF & _
"Metrics are defined as:" & @CRLF & _
"\begin{align}" & @CRLF & _
" P &= \frac{1}{n} \sum_{T \in \mathcal{T}} \frac{A_{T \cap T'}}{A_{T'}} \\" & @CRLF & _
" R &= \frac{1}{n} \sum_{T \in \mathcal{T}} \frac{A_{T \cap T'}}{A_T} \\" & @CRLF & _
" C &= \frac{|n-n'|}{n}" & @CRLF & _
"\end{align}"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm