Author Topic: Performing a regex on a string without parse  (Read 3842 times)

bercikr

  • Community Member
  • Posts: 45
  • Hero Points: 2
Performing a regex on a string without parse
« on: May 20, 2008, 04:04:42 pm »
Hi,

    How do i perform a simple regex on a string without using parse? I am just trying to do something like this, but I don't want to modify the buffer I am working on really.

_str function_line = "Function fName1(param1:val1,param2,param3)";
_str strippedLine = replace(function_line, "<MYREGEX>", "UI");

    do i just have to modify the buffer and undo? I'd rather not do that if there is a better way.


Thanks,
Rob


hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: Performing a regex on a string without parse
« Reply #1 on: May 20, 2008, 04:59:47 pm »
You might use get_line() to retrieve the current line (p_line) as string and replace() etc. - HS2