OpenVAS Scanner 23.23.1
nasl_text_utils.h File Reference
#include "nasl_lex_ctxt.h"

Go to the source code of this file.

Functions

tree_cellnasl_string (lex_ctxt *)
tree_cellnasl_rawstring (lex_ctxt *)
tree_cellnasl_strlen (lex_ctxt *)
tree_cellnasl_strcat (lex_ctxt *)
tree_cellnasl_display (lex_ctxt *)
tree_cellnasl_hex (lex_ctxt *)
tree_cellnasl_hexstr (lex_ctxt *)
tree_cellnasl_ord (lex_ctxt *)
tree_cellnasl_tolower (lex_ctxt *)
tree_cellnasl_toupper (lex_ctxt *)
tree_cellnasl_ereg (lex_ctxt *)
 Matches a string against a regular expression.
tree_cellnasl_eregmatch (lex_ctxt *)
 Does extended regular expression pattern matching.
tree_cellnasl_ereg_replace (lex_ctxt *)
 Search for a pattern in a string and replace it.
tree_cellnasl_egrep (lex_ctxt *)
 looks for a pattern in a string, line by line.
tree_cellnasl_match (lex_ctxt *)
tree_cellnasl_split (lex_ctxt *)
tree_cellnasl_chomp (lex_ctxt *)
 Takes an unnamed string argument and removes any spaces at the end of it. "Space" means white space, vertical or horizontal tabulation, carriage return or line feed.
tree_cellnasl_substr (lex_ctxt *)
tree_cellnasl_insstr (lex_ctxt *)
tree_cellnasl_strstr (lex_ctxt *)
tree_cellnasl_crap (lex_ctxt *)
tree_cellnasl_int (lex_ctxt *)
tree_cellnasl_stridx (lex_ctxt *)
 Returns index of a substring.
tree_cellnasl_str_replace (lex_ctxt *)

Function Documentation

◆ nasl_chomp()

tree_cell * nasl_chomp ( lex_ctxt * lexic)

Takes an unnamed string argument and removes any spaces at the end of it. "Space" means white space, vertical or horizontal tabulation, carriage return or line feed.

◆ nasl_crap()

tree_cell * nasl_crap ( lex_ctxt * lexic)

◆ nasl_display()

tree_cell * nasl_display ( lex_ctxt * lexic)

◆ nasl_egrep()

tree_cell * nasl_egrep ( lex_ctxt * lexic)

looks for a pattern in a string, line by line.

NASL Function: egrep\n
NASL Named Parameters:\n
  • string String to search the pattern in
  • pattern the patern that should be matched
  • icase case insensitive flag
  • rnul replace the null char in the string. Default TRUE.
NASL Returns:\n The concatenation of all lines that match. Null otherwise.
Parameters
[in]lexicLexical context of NASL interpreter.

◆ nasl_ereg()

tree_cell * nasl_ereg ( lex_ctxt * lexic)

Matches a string against a regular expression.

NASL Function: egrep\n
NASL Named Parameters:\n
  • string String to search the pattern in
  • pattern the patern that should be matched
  • icase case insensitive flag
  • rnul replace the null char in the string. Default TRUE.
  • multiline Is FALSE by default (string is truncated at the first “end of line”), and can be set to TRUE for multiline search.
NASL Returns:\n The first found pattern.
Parameters
[in]lexicLexical context of NASL interpreter.

◆ nasl_ereg_replace()

tree_cell * nasl_ereg_replace ( lex_ctxt * lexic)

Search for a pattern in a string and replace it.

NASL Function: ereg_replace\n
NASL Named Parameters:\n
  • string String to search the pattern in
  • pattern patern to search in the string for
  • replace string to replace the pattern with
  • icase case insensitive flag
  • rnul replace the null char in the string. Default TRUE.
NASL Returns:\n The new string with the pattern replaced with replace
Parameters
[in]lexicLexical context of NASL interpreter.

◆ nasl_eregmatch()

tree_cell * nasl_eregmatch ( lex_ctxt * lexic)

Does extended regular expression pattern matching.

NASL Function: eregmatch\n
NASL Unnamed Parameters:\n
  • pattern An regex pattern
  • string A string
  • icase Boolean, for case sensitve
  • find_all Boolean, to find all matches
  • rnul replace the null char in the string. Default TRUE.
NASL Returns:\n An array with the first match (find_all: False)
or an array with all matches (find_all: TRUE). NULL or empty if no match was found.
Parameters
[in]lexicLexical context of NASL interpreter.

◆ nasl_hex()

tree_cell * nasl_hex ( lex_ctxt * lexic)

◆ nasl_hexstr()

tree_cell * nasl_hexstr ( lex_ctxt * lexic)

◆ nasl_insstr()

tree_cell * nasl_insstr ( lex_ctxt * lexic)

Syntax: insstr(s1, s2, i1, i2) or insstr(s1, s2, i1) Insert string s2 into slice [i1:i2] of string s1 and returns the result Warning: returns a CONST_DATA!

◆ nasl_int()

tree_cell * nasl_int ( lex_ctxt * lexic)

◆ nasl_match()

tree_cell * nasl_match ( lex_ctxt * lexic)

◆ nasl_ord()

tree_cell * nasl_ord ( lex_ctxt * lexic)

◆ nasl_rawstring()

tree_cell * nasl_rawstring ( lex_ctxt * lexic)

◆ nasl_split()

tree_cell * nasl_split ( lex_ctxt * lexic)

◆ nasl_str_replace()

tree_cell * nasl_str_replace ( lex_ctxt * lexic)

str_replace(string: s, find: f, replace: r [,count: n])

◆ nasl_strcat()

tree_cell * nasl_strcat ( lex_ctxt * lexic)

◆ nasl_stridx()

tree_cell * nasl_stridx ( lex_ctxt * lexic)

Returns index of a substring.

Returning NULL for "not found" is dangerous as automatic conversion to to integer would change it into 0. So we return (-1).

Returns
-1 if string not found, otherwise index of substring.
See also
strstr

◆ nasl_string()

tree_cell * nasl_string ( lex_ctxt * lexic)

◆ nasl_strlen()

tree_cell * nasl_strlen ( lex_ctxt * lexic)

◆ nasl_strstr()

tree_cell * nasl_strstr ( lex_ctxt * lexic)

◆ nasl_substr()

tree_cell * nasl_substr ( lex_ctxt * lexic)

Syntax: substr(s, i1) or substr(s, i1, i2) Returns character from string s starting for position i1 till the end or position i2 (start of string is 0)

◆ nasl_tolower()

tree_cell * nasl_tolower ( lex_ctxt * lexic)

◆ nasl_toupper()

tree_cell * nasl_toupper ( lex_ctxt * lexic)