is_valid_regex_pattern Function

private pure elemental function is_valid_regex_pattern(pattern) result(res)

The function validating a given regex patten.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: pattern

Return Value logical


Source Code

   pure elemental function is_valid_regex_pattern (pattern) result(res)
      !! The function validating a given regex patten.
      implicit none
      character(*), intent(in)  :: pattern
      logical                   :: res

      character(:), allocatable :: buff
      type(tree_t)              :: tree

      buff = trim(pattern)
      call tree%build(buff)

      res = tree%is_valid_pattern
   end function is_valid_regex_pattern