Finally i made an acronym replacer that uses regular expressions to do the job or checking and replacing acronyms. To use this alias follow the directions below.
;Regular Expression Acronym Replacer
;Script By: DarthReven
;-----------------------------------
;To use this addon add the alias to any "ON INPUT" event
;Then add each acronym in this format:
;/hadd REG_ACRO_TABLE <acronym> <acronym meening>
;EX: /hadd REG_ACRO_TABLE lol laughing out loud
;------------------------------------
alias REG_ACRO {
VAR %REG_ACRO_INPUT $1-, %REG_ACRO_TOK $HGET(REG_ACRO_TABLE,0).DATA, %REG_ACRO_TEMP, %REG_ACRO_OUTPUT
WHILE (%REG_ACRO_TOK) {
IF ($REGEX(REG_ACRO_EX,%REG_ACRO_INPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig))) {
%REG_ACRO_TEMP = $REGSUB(%REG_ACRO_INPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).DATA,%REG_ACRO_OUTPUT)
%REG_ACRO_TEMP = $REGSUB(%REG_ACRO_OUTPUT,$+(/\b,$CHR(40),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).ITEM,$CHR(41),\b/ig),$HGET(REG_ACRO_TABLE,%REG_ACRO_TOK).DATA,%REG_ACRO_INPUT)
}
DEC %REG_ACRO_TOK
}
TOKENIZE 32 $IIF(%REG_ACRO_OUTPUT,$v1,%REG_ACRO_INPUT)
RETURN $+($UPPER($LEFT($1,1)),$MID($1-,2))
}
ON *:START: { hmake REG_ACRO_TABLE 1000 | hload REG_ACRO_TABLE REG_ACRO_TABLE.HSH }
ON *:EXIT: { hsave -o REG_ACRO_TABLE REG_ACRO_TABLE.HSH }
The $replacecs looks weird and out of order, I don\'t really see why you hard coded an acronym in your code. You say: \"Note: The acronyms thank you and no problem are already inputed in the main part of the alias do to regex\'s case sensitive nature\". Well, the truth is, regex is as case (in)sensitive as you specify it to be. If you use the /i switch, it will make the check case insensitive, which is probably what you are looking for.