futil

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package futil provides helper functions for interacting with files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractString

func ExtractString(filepath string, exp string) (match string, err error)

ExtractString reads the filepath data then compiles the given regular expression exp and applies it to the data and returns the results. Match will be empty if no matches were found. Use (?m) to have ^ $ apply to each line in the string. Use (?s) to have . span lines.

func ExtractStringP

func ExtractStringP(filepath string, exp *regexp.Regexp) (match string, err error)

ExtractStringP reads the filepath data then applies the given regular expression to the data and returns the results. See ExtractString

func ExtractStrings

func ExtractStrings(filepath string, exp string) (matches []string, err error)

ExtractStrings reads the filepath data then compiles the given regular expression exp and applies it to the data and returns the results. Matches will be nil if no matches were found. Use (?m) to have ^ $ apply to each line in the string. Use (?s) to have . span lines.

func ExtractStringsP

func ExtractStringsP(filepath string, exp *regexp.Regexp) (matches []string, err error)

ExtractStringsP reads the filepath data then applies the given regular expression to the data and returns the results. See ExtractStrings

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL