# Need Help with Code MIRC

### By manquosh on Jun 05, 2022

Need help with a code driving me CRAZY remove [xxxxx]

\$rbkx(\$chr(91),\$chr(93),[1] 2 [3]) returns 2
\$rbkx(\$chr(91),\$chr(93),[1] 2 ]3[) returns Error should return 2 ]3[
\$rbkx(\$chr(91),\$chr(93),[1] ]2[ ]3[) returns Error should return ]2[ ]3[

what am i doing wrong ?

Can any one help.

``````alias rbkx {
if (\$3 == \$null) return \$1-
set %temp \$3-
set %l 1
set %r 1
while ((\$1 isin %temp) && (\$2 isin %temp)) {
while (\$pos(%temp,\$1,%l) > \$pos(%temp,\$2,%r)) {
inc %r
}
set %temp \$left(%temp,\$calc(\$pos(%temp,\$1,%l)-1)) \$+ \$right(%temp, \$calc(\$len(%temp) - \$pos(%temp,\$2,%r)))
}
return %temp
}
``````

\$rbkx(\$chr(91),\$chr(93),[1] 2 [3]) returns 2
\$rbkx(\$chr(91),\$chr(93),[1] 2 ]3[) returns Error should return 2 ]3[
\$rbkx(\$chr(91),\$chr(93),[1] ]2[ ]3[) returns Error should return ]2[ ]3[

wikiwalls   -  28 days ago

I can't understand this.

MMX   -  Jun 23, 2022

Try this one:
Syntax: \$rbkx(text or %variable here)
Example: \$rbkx([1] ]2[ ]3[)

` alias rbkx { return \$regsubex(\$1-,/(\[[^\s].*?\])/ig,\$null) } `
rorshah   -  Jun 12, 2022

alias rbkx {
if (\$3 == \$null) { return \$1- }
set %temp \$3-
set %l 1
set %r 1
if (\$1 isin %temp) && (\$2 isin %temp) {
while (\$pos(%temp,\$1,%l) > \$pos(%temp,\$2,%r)) {
inc %r
}
set %temp \$left(%temp,\$calc(\$pos(%temp,\$1,%l)-1)) \$+ \$right(%temp, \$calc(\$len(%temp) - \$pos(%temp,\$2,%r)))
}
return %temp
}

Something like that?

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.