Skip to main content
Question

Regex to extract string

  • August 16, 2023
  • 3 replies
  • 960 views

katt
Supporter
Forum|alt.badge.img+12

When I am using a regex in a string searcher, the output is as expected. When I am using the same regex as @FindRegularExpression in the Attribute Manager, my script always fails. What do I need to modify in the Attribute Manager regex? Thanks21

3 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • August 16, 2023

@FindRegularExpression returns the index of the match. @SubstringRegularExpression will return the match itself, similar to the StringSearcher.


katt
Supporter
Forum|alt.badge.img+12
  • Author
  • Supporter
  • August 16, 2023

@FindRegularExpression returns the index of the match. @SubstringRegularExpression will return the match itself, similar to the StringSearcher.

@dustin​ I tried it previously as well but it didn't work either. Am I missing anything ?3


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • August 16, 2023

@dustin​ I tried it previously as well but it didn't work either. Am I missing anything ?3

There are additional inputs needed for @SubstringRegularExpression. Try this:

@SubstringRegularExpression(@Value(path_windows),.*(?<=\\),0,0,0,caseSensitive=TRUE)