Skip to content

Character Functions

⬅ Parent


isCharacterClass

Poor-man's bash character class matching

Usage

isCharacterClass className character0 [ character1 ... ]

Poor-man's bash character class matching

Returns true if all characters are of className

className can be one of: alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

characterClassReport

Write a report of the character classes

Usage

characterClassReport [ --help ] [ --class ] [ --char ]

Write a report of the character classes

Arguments

  • --help - Optional. Flag. Display this help.
  • --class - Optional. Flag. Show class and then characters in that class.
  • --char - Optional. Flag. Show characters and then class for that character.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

characterClasses

List the valid character classes allowed in isCharacterClass

Usage

characterClasses

List the valid character classes allowed in isCharacterClass

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

characterFromInteger

Given a list of integers, output the character codes associated

Usage

characterFromInteger

Given a list of integers, output the character codes associated with them (e.g. chr in other languages)

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

characterToInteger

Convert one or more characters from their ascii representation to

Usage

characterToInteger [ character ... ]

Convert one or more characters from their ascii representation to an integer value. Requires a single character to be passed

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

isCharacterClasses

Does this character match one or more character classes?

Usage

isCharacterClasses character [ class0 class1 ... ]

Does this character match one or more character classes?

Arguments

  • character - Required. Single character to test.
  • class0 - Optional. A class name or a character to match. If more than is supplied, a single value must match to succeed (any).

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

stringValidate

Ensure that every character in a text string passes all

Usage

stringValidate text class0 [ ... ]

Ensure that every character in a text string passes all character class tests

Arguments

  • text - Text to validate
  • class0 - One or more character classes that the characters in string should match

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error