Regex help!!!

ajneo7

New member
Hi, I need to help in Regex

Scenario 1: Need to extract first sentence till the \n and place it in a local variable
Example:
If below is the content in one of the variable, then I need to fetch only 'This is my sentence1' and place it in another local variable
-----------------------
This is my sentence1\nThis is my sentence 2\nThis is my sentence3\n
----------------------

Scenario 2: Need to skip the first sentence till the \n, and place the rest in local variable.
Example:
If below is the content in one of the variable, then I need to fetch 'This is my sentence 2\nThis is my sentence3\n' and place it in another local variable
-----------------------
This is my sentence1\nThis is my sentence 2\nThis is my sentence3\n
----------------------
 

tenduramax2

New member
This looks like you'll need regex to save each sentence to a variable then 'else/if' statements to move it along after each capture. However, more info is needed plz.

Are we to assume correct punctuation? Are there actual New Lines '\n' or is the data just 'Word Wrapped'?

If you could provide actual snippets of the data (real or fake) would help greatly. Thanks

v/r ~Shannon
 

ajneo7

New member
This looks like you'll need regex to save each sentence to a variable then 'else/if' statements to move it along after each capture. However, more info is needed plz.

Are we to assume correct punctuation? Are there actual New Lines '\n' or is the data just 'Word Wrapped'?

If you could provide actual snippets of the data (real or fake) would help greatly. Thanks

v/r ~Shannon
@tenduramax2 Thanks for the reply!
Yes they are actual new lines(\n).
Example content:
This is my sentence1\nThis is my sentence 2\nThis is my sentence3\n
 
Top