You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.

FIND


Looks for a string pattern within another string and returns the first matching characters. The function is case-sensitive.


Syntax

FIND ( pattern , string )
FIND ( pattern , string , startIndex )



Inputs
  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
  • string - An attribute of base type string or an expression that results in a string.
  • startIndex - A positive integer value indicating at which character of the string the search should start (inclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The first character starts at index 0.


Return type

  • string


Examples

Entity.attributeValueType
File.name"Thisfile_1.doc"String
ExpressionResultType
FIND ( "_[1-5]" , File.name )"_1"String
FIND ( "File" , File.name )UNKNOWNString
FIND ( "el" , "Hello" )"el"String
FIND ( "el" , "Hello" , 2 )UNKNOWNString
FIND ( "eo" , "Hello" )UNKNOWNString
FIND ( "\s[a-zA-Z]+" , "Hello world example" )"world"String
FIND ( "\s[a-zA-Z]+" , "Hello world example" , 6 )"example"String


Back to Top

 

4 Comments

  1. What is the character to use to escape a double quote (") within the pattern?

    1. I've used \x22 to represent " for other characters see https://en.wikipedia.org/wiki/ASCII

      1. Unknown User (a.jansen)

        Hi Ronald Peterson , noticed your comment, but saw that you already found an answer. A more concrete example for other readers: if you define a string attribute, for example Singleton.String with the constant value, including the double quotes "Test", FIND ("\x22", Singleton.String) will return a String value result with a double quote. 

      2. Unknown User (a.jansen)

        Btw, you can also post questions to the community here: https://my.blueriq.com/questions