The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

[SOLVED] Regular expression \d does not work at function find(a,b)

CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
edited June 2019 in Help
Dear All!

I found that using the 'find()' function eg. at Generate Attributes operator, '\d' regular expression does not work, it throws a Syntax Error.
Eg. finds("10","\d+") throws Error: 'Syntax error'
If I use '[0-9]' the above example works well: finds("10","[0-9]+") will give 'true' value.

Is it a bug?

Thank you!
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    because the value you entered is first read by Java, you need to escape the first backslash as well. So if you change your expression to finds("10","\\d+") it will work.

    Regards,
    Marco
  • CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    Thank you!!
Sign In or Register to comment.