Skip to main content
Question

Regex to extract string

  • Aug 16, 2023 3:01 PM UTC
  • 3 replies
  • 1295 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+36
  • Influencer
  • Aug 16, 2023 3:34 PM UTC

@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
  • Aug 16, 2023 4:02 PM UTC

@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+36
  • Influencer
  • Aug 16, 2023 4:16 PM UTC

@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)