Extract Function

Certified Associate Developer

Hi All I have requirement to get the values between  square brackets iam achieving it with the help of  extract function but when i was trying to insert the brackets after entering value and if my text value has uneven number of brackets it is erroring out

  

can you suggest is their any other alternate way to achieve this 

  Discussion posts and replies are publicly visible

Parents
  • I would encourage you to validate the incoming string before you attempt to use the extract() function on it. There are probably a few ways to do this but in essence if you check that the string you want to process contains an even number of "[" and "]" characters then you'll avoid the error. What might be a bit harder to achieve is to ensure that every "[" has a following "]" without another intervening "["...if that even matters to you? But the principle here: don't attempt to process data that is effectively invalid.

Reply
  • I would encourage you to validate the incoming string before you attempt to use the extract() function on it. There are probably a few ways to do this but in essence if you check that the string you want to process contains an even number of "[" and "]" characters then you'll avoid the error. What might be a bit harder to achieve is to ensure that every "[" has a following "]" without another intervening "["...if that even matters to you? But the principle here: don't attempt to process data that is effectively invalid.

Children