🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

replace hyphen

User: "pb42"
New Altair Community Member
Updated by Jocelyn
I am trying to replace a hyphen from a Grade attribute by using the Replace operator. I would like to replace it with text that describes no value has been entered (i.e., Not indicated). The problem is that the attribute includes values such as - (the hyphen I want to replace), A-, B-, C-. Using the replace operator replaces all of the hyphens (including those being used as minuses). I tried using the regular expression, \b[-]\b, but that is not working. I also tried, \b["-"]\b without success.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Edin_Klapic"
    New Altair Community Member
    Accepted Answer
    Hi @pb42 ,
    in the Replace Operator you need to use the expression
    ^-$
    in the replace what parameter and replace it by Not indicated.
    That way only the single hyphens are replaced and the minuses (i.e. A-, B-,...) are kept.
    Short explanation:
    RapidMiner uses the Java RegEx functions: The ^ represents the beginning of a line, the $ represents the end of a line.
    Happy Mining,
    Edin