Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert to uppercase
#1
Hello,

I need to convert some characters to uppercase. My question is can this be done with a regular expression because there is no strict way to do this for me like with the ucase command. I like to search for example in a text for every 'dot' and a 'character' afterwards if found it must be an uppercase character...

if possible please give me an example

Thanks in advance!
#2
Use callback function with replacerx.

Macro Macro1568
Code:
Copy      Help
str s=
;Hello,
;
;I need to convert some characters to uppercase. my question is can this be done with a regular expression because there is no strict way to do this for me like with the ucase command. i like to search for example in a text for every 'dot' and a 'character' afterwards if found it must be an uppercase character...
;
;if possible please give me an example
;
;Thanks in advance!

REPLACERX r.frepl=&replacerx_callback2
int n=s.replacerx("\. [a-z]" r)
out
out "%i replacements" n
out s

Function replacerx_callback2
Code:
Copy      Help
;/
function# REPLACERXCB&c

;c.match contains found text. You can modify it (it will become replacement text).

c.match.ucase


Forum Jump:


Users browsing this thread: 1 Guest(s)