Skip to main content
Solved

Remove all text between two characters.

  • September 19, 2022
  • 2 replies
  • 2051 views

bjudes
Enthusiast
Forum|alt.badge.img+10

Hi,

I have multiple strings that are in this format 560_20170619_0900, I would like to remove all before and after the '_', leaving me with just 20170619. Is this possible using the attribute trimmer and regex?

Thanks

B

Best answer by nielsgerrits

I reckon this can be done usin' only a StringSearcher 'n a regex:

(?<=_).*?(?=_)

Found it here.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2937 replies
  • Best Answer
  • September 19, 2022

I reckon this can be done usin' only a StringSearcher 'n a regex:

(?<=_).*?(?=_)

Found it here.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • 117 replies
  • September 19, 2022

I reckon this can be done usin' only a StringSearcher 'n a regex:

(?<=_).*?(?=_)

Found it here.

Thanks Niels, worked perfectly!!