🎉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

Why am I getting "inadmissible input" for regex in "finds" expression?

User: "LearnAW"
New Altair Community Member
Updated by Jocelyn
I have a Generate Attributes operator with an expression that uses the "finds" function.  It takes the existing nominal attribute Link_prefix, which contains URL strings, and I want to check for the existence of an IP address in the URL.  My expression looks like this:

finds(Link_prefix, "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")

i.e. a regex looking for four numbers from 1-3 digits, separated by periods. However, it gives me the following error message:  Error: Inadmissible input at "".  It has an arrow pointing at the opening quotes in the regex expression.  What am I doing wrong?  Why is the opening quotes of the regex producing an error?  I've looked at several questions in RapidMiner Community with examples of regex expressions, and they look like they're formatted the same way mine is.

My xml details are as follows.  (Please don't ask for the entire process xml.  It's lengthy, and sensitive.)

- Version:
<?xml version="1.0" encoding="UTF-8"?><process version="9.0.003">

- Operator:
      <operator activated="true" class="generate_attributes" compatibility="9.0.003" expanded="true" height="82" name="Generate Attributes (4)" width="90" x="581" y="34">
        <list key="function_descriptions">
          <parameter key="IP_in_link" value="finds(Link_prefix, &quot;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}&quot;)"/>
        </list>
      </operator>

Thanks for any help!!  I'm getting frustrated with repeated roadblocks in simple attribute extraction, before I even get to the modeling.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "jacobcybulski"
    New Altair Community Member
    Accepted Answer
    Try changing you backslashes into double backslashes. The first will ensure that the second will be used as part of your regular expression, otherwise a single backslash before "d" would simply escape "d" making it a "normal" character (which already is). In other words use the following function with a regular expression:
    • finds(URL,"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}")
    Jacob