Extract any length text as entity after a specific text

I want to extract any text as entity after a specific text. For example nlu entry would look like -> ##intent:direct_search_db I want to search for entity of any length

regex:search_string

I want to search for([^\n\r]*)

So in this case if user gives text ->

  1. I want to search for string of any lenght to go . Entity extracted must be -> ‘string of any length to go’

  2. If user gives text -> I want to search for any other string. Entity extracted must be -> ‘any other string’

How do I achieve this? Entity is not getting extracted properly. I want to extract any string as entity which is given after specific text like in example after ‘I want to search for’ .

@deepakmits The best way to achieve this is to write your own custom component (see Custom NLU Components). You should create your own Entity Extractor that just takes the input text, applies a regex and return some entities. It should be sufficient if you overwrite the process method. If you need an example of an entity extractor take a look at https://github.com/RasaHQ/rasa/blob/master/rasa/nlu/extractors/mitie_entity_extractor.py. Let me know if you have any other questions.