How to make the output of LLM(mistral ai) iteraterable by next term?

i wanna deal with the output of mistral ai ,to process every h2 by perplexity.

output of misral is like:


<h1>Hot Topics in AI Search Engines</h1>

<h2>1. Neural Search</h2>
<p>Neural search is a technique that uses deep learning models to improve the relevance and accuracy of search results. It has the potential to significantly enhance the search experience for users.</p>

<h2>2. Semantic Search</h2>
<p>Semantic search is the use of natural language processing and machine learning to understand the intent and context of a user's search query. It can help search engines provide more accurate and relevant results.</p>

<h2>3. Conversational Search</h2>
<p>Conversational search is a type of search that allows users to interact with search engines using natural language conversations. It has the potential to make search more intuitive and user-friendly.</p>



Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

<h2>[\w\W]+?(?=\s+<h2>|\s*$)

Proof

https://regex101.com/r/eqZlBq

Important Info

  • :warning: Global match must be set to YES!
  • :warning: Multiline must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

2 Likes

thx it works。

and how to just only grab

<h2>1. Neural Search</h2> 

?
is there any guide for regx newbie…

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

1 Like