BookmarkSubscribeRSS Feed
aaaaa34
Calcite | Level 5

Hi,

 

How can I delete "qt" in 0,023qt using regex?

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20
data test;
   string="0,023qt";
   newstring=prxchange('s/qt//', -1, string);
run;
aaaaa34
Calcite | Level 5
Is it possible to use PRXPARSE? I'd like to use it in my code.
PeterClemmensen
Tourmaline | Level 20

The PRXPARSE Function simply compiles the rexex for later use. Sure you can use it, but you don't really benefit from it, since PRXCHANGE accepts an actual regular expression and not only the compiled rexex id

 

data test;
   string="0,023qt";
   rx=prxparse('s/qt//');
   newstring=prxchange(rx, -1, string);
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1587 views
  • 1 like
  • 2 in conversation