regfree(3f) - [M_regex] Release storage used by the internal form of the RE (Regular Expression)
Synopsis
Description
Options
Examples
subroutine regfree(this)
type(regex_type), intent(inout) :: this
regfree(3f) frees any dynamically-allocated storage used by the internal form of an RE.
The regfree(3f) function frees any dynamically-allocated storage associated with the compiled RE pointed to by THIS. The remaining regex_type is no longer a valid compiled RE and the effect of supplying it to regexec() or regerror() is undefined.
THIS a compiled regular expression previously allocated using regcomp(3f).
Sample program
program demo_regfree use M_regex, only: regex_type, regcomp, regexec, regmatch, regfree, regerror implicit none integer :: istat type(regex_type) :: regex character(len=:),allocatable :: expression expression= "([0-9\.\-\*\/]+)+" call regcomp(regex,expression,x) if (istat/=0) then stop Regex runtime error: regcomp failed. endif call regfree(regex) end program demo_regfree
Nemo Release 3.1 | regfree (3) | February 23, 2025 |