Use a StringSearcher. Let your regex find all words. Write all matches to a list. Item 0 of the list contains the first match (you can also write the first match to an attribute in the StringSearcher), item 3 of the list contains the fourth match.
Use a StringSearcher. Let your regex find all words. Write all matches to a list. Item 0 of the list contains the first match (you can also write the first match to an attribute in the StringSearcher), item 3 of the list contains the fourth match.
If using the StringSearcher, you can use the Subexpression Matches List Name and that will return just the 1st and 4th words as two list items(the items within the brackets in the regex)
Use a StringSearcher. Let your regex find all words. Write all matches to a list. Item 0 of the list contains the first match (you can also write the first match to an attribute in the StringSearcher), item 3 of the list contains the fourth match.
@williamlin98 Attach is a workspace which I hope provides you with another alternative solution. As others have suggested, you will still need to create a list. It seems to me that the value of your attribute is separated by hyphen. If that is the case then splitting your attribute value works out better.
You can also extract the first and fourth words within an AttributeCreator/AttributeManager using the StringFunction @SubstringRegularExpression. The 1 and 2 in these expressions refer to the 1st and 2nd match groups