# Smart Assistant

The Smart Assistant is an intelligent tool designed to automatically provide the User with necessary functions in the field of programming and/or regular expressions based on a textual description.

Smart assistants come in several types:

* in the expression editor,
* in the regular expression generator,
* for code generation in code editors.

1. #### Smart Assistant in the Expression Editor

Open the project in Sherpa Designer, add the “Execute PowerShell Expression” block to the diagram:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdI9qskEdkLySKnURS0vP3CGHG6fP-qzxccsfLA1-mTpSpFrKyWlCNJsG-cghlkiyYt55DHBG-LscLDocNxIRBbASd6u8FSXVPrxpv7qQ3EasVTFvkh65MzLlyRJL8ikJAo-fh7aA?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdksQpwA-iFd0v3LOGpWkwQhjqWWYXgyAMM0TkmaMYNfOKduJX5a3nvW4R9V1_akxL5CW1ekr6tqgf3ltkMx5A7PNmVUikmQOiyWV5TVgmyX3lZ8daAdnZDna1gUnBWDi194rzB?key=2frHalbXRpccMssNXygBgA) to the right of any “Expression …” field on the “Properties Panel”:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcVu-cvYsu5UY56iny5KiYT4fXUKmLOLmZbCQAyymD-ouUqoPMqtoISOoZoeYUCqWfa7R_twHGx9woowyzUYOAFUihEmCUGwvnunmeE3CuNoJemtQ2v5Bt-iGBqBwenzTq8x7Yr?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

In the pop-up window “... Edit Expression”, click on the “Smart Assistant” tab:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfbAb18neS-fMFeibt8LPR2nlamVDvxhwYYgaM9zbEO-5egPWQVgJUc-hiU8tgcIPX1jjMPq2ydg6t1hsvxizkysxDnJcVsnnCeB-oHp88wfCubPBoM0PT7YXl4PX7jrI2W7Z78Sg?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Enter the textual description of the expression in the “Your Request” field:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeIZFxtHm7ulGI3Zi2aTrtmIDhYeNCHkXDvRXWsh5iorfIDmk-4KCjF6XwdQUbM4LajPDUVY_w_pTALcbtk392k-uDwEglQ0Q7R0jPMPj1Oa9ZnGIOlgWMRyb39RjkGtYpTSxPAkQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Click the “Submit” button and the smart assistant will suggest the necessary expression:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXekF7C3ivsXA8Zdh7bbUotVHVIZBO8my2IMWH-xb7_9IYh_EBmxhAXQlu1RYM8tZ20FoZe9codTNastvzHvXsNjWh8tYVYQaKEWVyowtLC1cJDrDKj0dHg9xdVTSBEyz4IGVrbpwg?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Next, copy the expression and enter it into the appropriate field in the “Main Properties”.

2. #### Smart Assistant in Sherpa Regex

Open the project in Sherpa Designer, find the “Open Sherpa Regex” icon in the “Advanced” menu: ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdKlKM3iYtFJyZghKcupbkACpbqbJX9Sehs9xwfLhOfQyvD-WoVafBpK9SYmI4J_aOvdteFgzn131mo4uce5_XmaS79QgRTEpfAo-P_kk0oIoNJr6MIY9ntn3VLHL1h5mHey3gLyg?key=2frHalbXRpccMssNXygBgA) , and double-click on it with the left mouse button.

In the pop-up window “Testing Regex …” enter the textual description of the expression in the “REQUEST” field:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf_H2vo4_DQWVL7zP6mma_dTHyFtchyeSz1lx4cCqFRFGIFrn2389I2czPDMvJ1jh9jaND27JlmSx3rGWGBmPfKat705S51dCWVjG21W6A-NYzDMWG1mVJYpfXlWzAsY9gwnx-wKQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Next, click the “Submit” button. The necessary expression will appear in the “TEMPLATE” field:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXev_5Fh5b9_vixsADYWm2w43jf5mfsfyvh_yzDdWNCiUTZo2BgZ0PRNdC-Z7i55BqSCUaN_KQSsSDSP4jhiyOzKNrao8Ccp8MR4g5qknXx1kR22553Y483XfdLZ77SGdNI5XJ8xsQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Copy the expression and enter it into the appropriate field in the “Testing” tab.

3. #### Smart Assistant for Code Generation in Code Editors

Open the project in Sherpa Designer, add one of the blocks to the diagram:

* “Execute C# Code”:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeIsWJYLYBwKcF7-3q2DjbxLsmiZkQBmQu8smL6iLrU_ugofhgpRsJEalUQqRWVmNmCykKAtLThsgMeodz91F4mPNZbKTY9xG2PBL6Abb3-qM52s6XJo0saB0ZLrYs58DlIiZJ1YQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

* “Execute Python Code”:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdCO2Fgw2bD2RYMlmHRe7YBhQWBnr6t5DUXeNl7yU1pv4CBBo3txN6RiPXnO9ebeWNmhw2srM0s6kJn1t9U_lHAI-FMuzsu9_wMA17i6Kz1UKNij1S6rY00AUvCOYPD1Wy342f0?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

* “Execute Java Code“:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfP37eKtWlshVDQG7vSBMcNIKm0Om1Kv22If3RxTdnOIo84yU2-xqsPDjN1dthZ01l0Nu7gVXhIMKloRtv_fRCTc_1S0Ig2EKOy-TtOlW0nnWQssi6kPL6SJlXYdx0IxdWzxZbNzg?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

* “Execute VB Code”

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0zeCTb5dHEihzwHJkB-UUNLp_YrcJNvSu40vVJvUSZivt_E3V_k33qjuWhnHF9h4kSEUv7vyxxK6IUUbTnwXeuzC6wOZVNAzyyTinw_cXmZlgYfUrYmXIghiWV9uFX1WX81XpJQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdX4zmRB2KZY-mq4PvUy9tFQOPdqQpJRuXr3Jgx49tGYabogWLO_7B33U4O_hHpuUd2zdc12MgQGDh4maRWgSJ0tpOivkz_LWk5YYsfuvrszIDXPTr6ydKN8hcTbLgYkXkBsogaHw?key=2frHalbXRpccMssNXygBgA) inside the block. In the “Editor … Code” window, click the button ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc5TFTf4hdXOzzu4DQz0zwzfRpzflms5dP0rMx3A5iJ6xZpd6oYSEaji1ftPIiHU30BnsuEQSKhOXx15tQQbL1BkoZbqyBP0_mEmbQgP0p0P90Wa-Io5n1Q74pcyBU0sPvrcWiE1A?key=2frHalbXRpccMssNXygBgA).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeOrP5uoeUqKaeroG3DCDcNMd6Vode5nO9pfk9ngOgmbojffZwik6o2hTOENnO6Okp2LuNYNG2tbnqVI2lm_bS5O9ohBpEWa7CGIo75l66N-khmmLTnMW5NMarOMkHNFRXK3qIrDQ?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

In the pop-up window “Smart Assistant”, enter the textual description of the code in the “Current Request” field:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf7IZAswcMuoIw1ykCLG2K3OhVMbwM-h9LtCOUyWswoUnlLFUQg8wwWlVTlJZqs4TI7Nh2XDo4uv53EdUuf55fkGO4ZmhjLz8PMJCTEU1XsvjwJnAmF1MsqJAOHMfxnCluIDh11?key=2frHalbXRpccMssNXygBgA" alt=""><figcaption></figcaption></figure>

Click the “Generate Code” button. The code in the desired programming language will appear in the “Editor … Code” window.
