regina(1)
π regina β The Regina Rexx Interpreter π
okay bestie, sit down, grab a boba, because we're about to talk about regina, the Regina Rexx Interpreter, and honestly? she's iconic. no cap. π«Ά
β¨ SYNTAX β¨
regina [ options ] [ script [ scriptparams ]]
rexx [ options ] [ script [ scriptparams ]]
πΈ DESCRIPTION πΈ
so here's the vibe: regina will read the file named as script, and it's just gonna assume the contents of that file are a Rexx program, and then it interprets that program. that's the whole job. she reads, she interprets, she slays. π
any parameters that come after script get interpreted as the parameters to the Rexx program. like, those are the program's args, not regina's. iykyk.
if script isn't specified, or it's specified as -, then the Rexx program to interpret gets read from standard input, and interpretation starts when the whole program has been read. so like, she waits for the whole thing before she goes. patient queen. π
now, the regina executable supports the use of external function packages written to the SAA API, and loaded with the RxFuncAdd BIF. β¨
the rexx executable does not support the use of external function packages written to the SAA API, but it executes slightly faster than the regina executable. so it's giving "less features, more speed" energy. trade-offs, bestie, trade-offs. π
π OPTIONS π
-txβ sets tracing of the program to the option(s); "x" specified. anyTRACEcommands in the program will be ignored. so if you want to run your program with tracing set to "Intermediate", you can use the option-ti. if only-tis specified, "All" is the trace mode set. multiple tracing options can be specified. eg. to specify "intermediate", "interactive" tracing, specify-ti -t?.-iβ starts Regina in interactive mode. no script will be executed. just vibes, no script. π-vβ displays Regina version and exits. quick lil flex and then she's gone. π¨-aβ changes the way that arguments passed on the command line are made available to the called Rexx program. with this switch each parameter on the command line is available as a separate argument, rather then the normal behaviour of only making the combined command line arguments available as one internal argument. so like, everyone gets their own moment instead of being squished into one. main character energy for every arg. β-l[locale]β allows the user to specify the locale to be used. normally this switch is specified without the optional locale string, which uses the system's locale. π-pβ relevant only on Win32 platforms. results in aPress ENTER key to exit...prompt to be displayed at the end of execution. this is useful when a Rexx program is run from Windows Explorer. a little "hey bestie, i'm done, press a key" moment. π-rβ runs a Rexx program in a restricted mode where any no changes to the external environment are allowed. writing to files, loading external function packages, and running external commands are prohibited. she's locked in. she's in her safe space. do not test her. π«-ooptionsβ allows ReginaOPTIONSto be passed to the Rexx program. the value of options is in the same format as theOPTIONSinstruction. β¨-cβ compiles the specified script to a tokenised image and writes the image to an output file which is the the only other parameter allowed to be supplied. note: the original literally says "the the", and we respect the lore. π-eβ executes the specified script as a tokenised image. all other switches above are allowed. the tokenised image is not allowed to be supplied via stdin. sorry bestie, stdin girlies, not this time. π
lowkey important reminder: that -ooptions one is doing a lot of heavy lifting, don't skip her. π
part 2 is coming, don't go anywhere. π¦
β¨ Built-ins β¨
Okay bestie, here's the whole list of all the standard built-in functions in Rexx. For a more complete description of each function, see the documentation accompanying Regina. Fr fr, this is the whole menu. π«Ά
ABBREV(long,short[,length])β Returns1or0, depending on whether short is an abbreviation of long, or at least length characters. πABS(number)β Returns the absolute value of number. β¨ADDRESS()β Returns the name of the current environment. πΈARG([argno[,option]])β Without parameters, it returns the number of parameters. If onlyargnois specified, it must be a number, and that parameter is returned.Optioncan beE,NorO, and then either0or1is returned, depending on whether the numbered parameter existed or was omitted. The optionNis the same as not specifying an option. πB2X(binstring)β Converts the binary stringbinstringto a hex string. π¦BITAND(string1[,[string2][,padchar]])β Returns a string which is the bitwise AND of its two first parameters. The shorter string is padded withpadchar. πBITOR(string1[,[string2][,padchar]])β LikeBITANDbut uses logical OR. π₯BITXOR(string1[,[string2][,padchar]])β LikeBITANDbut uses logical XOR. πC2D(string[,length])β Converts the character stringstringto a decimal number.Lengthspecifies the number of characters instringto convert. πC2X(string)β Converts the character stringstringto a hex string. βCENTER(string,length[,padchar])β Centersstringin a string oflengthcharacters, usingpadcharfor padding, if necessary. πCENTRE(string,length[,padchar])β Centersstringin a string oflengthcharacters, usingpadcharfor padding, if necessary. πCHARIN([streamid][,[start][,length]])β Readlength(default is 1) characters from an input stream (default is the standard input stream), optionally starting at positionstart(default is the current read position). πCHANGESTR(string1,string,string2)β Changes all occurrences ofstring1in the stringstringtostring2. πCHAROUT([streamid][,[string][,start]])β Writesstreamto an output stream (default is the standard output stream), starting at positionstart(default is the current write position). π§CHARS([streamid])β Returns the number of characters left in the input stream (default is the standard input stream). πCOMPARE(string1,string2[,padchar])β Returns0or1, depending on whether the two strings are equal. The shorter string is padded withpadchar, or space if padchar is omitted. β¨CONDITION([option])β Performs various operations on streams, see other documentation. πΈCOPIES(string,copies)β Returnscopiescopies of the stringstring. πCOUNTSTR(string1,string)β Returns the number of occurrences ofstring1in the stringstring. π¦DATATYPE(string[,option])β Returns the datatype ofstring:NUMif it is a number,LITif it is as valid literal that does not have a variable value,VARif it is a variable, andBADotherwise. Ifoptionis specified, it must be one of these four, and then0or1is returned, depending on whetherstringis of the named type. πDATE([option-out,[date,[option-in]]])β Returns the date, in various formats, which can be Base, Century, Days, European, Month, Normal, Ordered, Standard, USA, UnixTime, or Weekday. Can also be used to convert a datedatefrom one formatoption-into another;option-out. π₯DELSTR(string,start[,length])β Deletes the substring ofstringstarting at positionstartand having a length oflength(default is the rest of the string). πDELWORD(string,start[,length])β Deleteslengthwords (default is the rest of the string) fromstring, starting at word numberstart. πDIGITS()β Returns the current setting of NUMERIC DIGITS. βD2C(integer[,length])β Converts the decimal numberintegerto a character string of lengthlength. πD2X(integer[,length])β Converts the decimal numberintegerto a hex string of lengthlength. πERRORTEXT(errno)β Returns the error text associated with error numbererrno.errnocan specify a sub-error number in the format n.n. eg. 40.1 πFORM()β Returns the current setting of NUMERIC FORM. πFORMAT(number[,[before][,[after][,[expp][,[expt]]]]])β Formatsnumberinto a string havingbeforedigits before andafterdigits after the decimal point. Theexppandexptgoverns how and when to use exponential form. π§FUZZ()β Returns the current setting of NUMERIC FUZZ. πINSERT(string1,string2[,position[,length[,padchar]]])β Insertsstring1intostring2at positionpositionand with a length oflength. β¨LASTPOS(needle,haystack[,start])β Seeks forneedleinhaystack, from the end towards the start. πΈLEFT(string,length[,padchar])β Returns thelengthleftmost characters instring. πLENGTH(string)β Returns the number of characters instring. π¦LINEIN([streamid][,[line][,count]])β Reads a line from an input stream (default is the standard input stream), optionally starting atline. Ifcountis zero, no reading is performed (only repositioning). πLINEOUT([streamid][,[string][,line]])β Writes the linestringto an output stream (default is the standard output stream, optionally starting atline. π₯LINES([streamid])β Returns the number of complete lines left in an input stream. πMAX(number1[,number2]...)β Returns the maximum of its parameters. πMIN(number[,number]...)β Returns the minimum of its parameters. βOVERLAY(string1,string2[,[start][,[length][,padchar]]])β Overwritesstring2with contents ofstring1. πPOS(needle,haystack[,start])β Seeks for first occurrence ofneedleinhaystack. πQUEUED()β Returns the number of lines in the external data queue (stack). πRANDOM(max)β Returns a random number in the rangemintomax(default is 0 and 100000). πRANDOM([min][,[max][,seed]])β Returns a random number in the rangemintomax(default is 0 and 100000). π§REVERSE(string)β Reverses the order of the characters instring. πRIGHT(string,length[,padchar])β Returns thelengthrightmost characters instring. β¨rxfuncadd(external,library,internal)β Loads an external function called;internalresiding in thelibraryshared library.externalis the name of the function as known to the interpreter. πΈSIGN(number)β Returns-1,0, or1, depending on the sign ofnumber. πSOURCELINE([lineno])β Returns the number of lines in the source for the current script, or the line specified bylineno. π¦SPACE(string[,[length][,padchar]])β Transform any sequence of spaces instringinto exactlylengthspaces, and strips off leading and trailing spaces. πSTREAM(streamid[,option[,command]])β Returns information about a stream, valid options areCommand,Description, andState. See other documentation for more information. π₯STRIP(string[,[option][,char]])β Strips leading and trailingchars offstring.Optioncan be Leading, Trailing, or Both. πSUBSTR(string,start[,[length][,padchar]])β Returns the substring ofstringstarting atstartand having lengthlength. πSUBWORD(string,start[,length])β Returns a subsequence oflengthwords fromstringstarting atstart. βSYMBOL(name)β Test whethernameis a numbol, variable, literal. πTIME([option-out,[time,[option-in]]])β Returns the time, options are Civil, Elapsed, Hours, Long, Minutes, Normal, Reset, and Seconds. Can also be used to convert a timetimefrom one formatoption-into another;option-out. πTRACE([setting])β Returns the current trace setting, and optionally sets a new one. πTRANSLATE(string[,[tableout][,[tablein][,padchar]]])β Translates characters instringfromtableintotableout. πTRUNC(number[,length])β Truncatesnumbertolengthdecimals. π§VALUE(symbol[,[value],[pool]])β Returns the value ofsymbol, optionally setting it tovalueafterwards. πVERIFY(string,ref[,[option][,start]])β Verifies thatstringsconsists of characters fromref, and returns the first character that does not match.Optioncan be Match or Nomatch. β¨WORD(string,wordno)β Returns word numberwordnoinstring. πΈWORDINDEX(string,wordno)β Returns the character position of word nun. πWORDLENGTH(string,wordno)β Returns the length of word numberwordnoinstring. π¦WORDPOS(phrase,string[,start])β Returns the word position of the start ofphraseinstring. πWORDS(string)β Returns the number of words instring. π₯XRANGE([start][,end])β Returns in alphabetic order all the characters in the character set from the characterstartto the characterend. πX2B(hexstring)β Converts the hex stringhexstringto a binary string. πX2C(hexstring)β Converts the hex stringhexstringto a character string. βX2D(hexstring[,length])β Converts thelengthrightmost characters of the hex stringhexstringto a decimal number. π
π Copyright π
The Regina Rexx interpreter is distributed under the GNU Library General Public License, see the file COPYING-LIB in the source code distribution. Periodt. π
βοΈ Author βοΈ
Anders Christensen, University of Trondheim, Norway <anders@pvv.unit.no>. π«Ά
π οΈ Maintainer π οΈ
Changes to Regina since 0.07a, Mark Hessling <mark (at) rexx.org> with significant assistance from Florian Grosse-Coosmann. π
π See Also π
There are several good reference books on Rexx. The most famous is "The Rexx Language" by Mike Cowlishaw. Visit https://www.rexxla.org (The Rexx Language Association) for any Rexx related information. π
And that's the whole regina(1) manual page, bestie β source/version and date are chillin' in the footer, iykyk πβ¨
π¦ where this page comes from
- debian trixie: regina-rexx 3.9.5+dfsg1-0.1+b1 Β· LGPL-2.0-or-later
- fedora 43: regina-rexx 3.9.6-5.fc43 Β· LGPL-2.0-only and LGPL-2.0-or-later and LGPL-2.1-or-later and MPL-1.0 and GPL-2.0-or-later and BSD-4-Clause and Unlicense
- fedora 44: regina-rexx 3.9.6-6.fc44 Β· LGPL-2.0-only and LGPL-2.0-or-later and LGPL-2.1-or-later and MPL-1.0 and GPL-2.0-or-later and BSD-4-Clause and Unlicense
- nixos 26.05: regina-rexx 3.9.7
- nixpkgs unstable: regina-rexx 3.9.7
- ubuntu noble: regina-rexx 3.9.5+dfsg1-0.1 Β· LGPL-2.0-or-later
- ubuntu questing: regina-rexx 3.9.5+dfsg1-0.2
- ubuntu resolute: regina-rexx 3.9.5+dfsg1-0.3 Β· LGPL-2.0-or-later
- ubuntu stonking: regina-rexx 3.9.5+dfsg1-0.3 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms