I wanna do this...How can I?

howto

#1

I want to to extract specific sentences those have special letter before and after.

EX. #He is a good boy@

Ex. The list of sentences are -> I know him #He is a good Boy@ Good to see you #Nice dress@ No one is perfect I am going back #Do you know him@

I want to extract specific sentences from this list with special sign before and after (# @)

So how can I do that?


#2

It you’re not talking about a ton of text you could split the text at # and again at @.


#3

That is the issue. For a single sentence, it’s easy to do with that method but I have to extract many sentences. So do you have any solution @Ken


#4

Use split at #:
Screenshot_20190518-180259_Chrome

It will create a list then use for loop and split at @


#5

Okay… Let me try…


#6

Hey ken, The at(list) option is not accepting the # I mean the text box.


#7

I updated my previous post.

Use regular split, I don’t know what I was thinking!


#8

Okay…Going for that one now


#9

Are you referring to this one :point_down:
Captureddsh

Capturenurcf

Please clarify the line…I have used this block but it is giving me the only last sentence of the list.


#10

Yes, now split item at @ and do what you want with the results.


#11

This is happening…


#12

Your only getting the last item in the loop because you aren’t storing each result.
Example:
In loop
You are using String = Result
You should use String = String & Result


#13

Captureok

I am using these blocks…


#14

This:

= This:


#15

the most simple way is to use REGEX extension.
my extension here http://www.kevinkun.cn/regex.html
and the block like %7B9F1O%25YM0T%25S%24OO6N12PFXU


#16

The page u referred is in Chinese so can you please explain a little bit more. Mainly about the pattern of the pattern.


#17

given a string:
<div>first para<p>this is 2nd para</p>another para<div>
now we want to get string between <p> and </p> ,use the pattern
<p>(.*?)</p>
you will get
<p>this is 2nd para</p>

if you want to NOT include <p> and </p> in the result, use pattern
(?<=<p>)(.*?)(?=</p>)


#18

Okay…got it…Thanks


#19

It works like a charm…:+1:


#20

mark it as a solution if it helps :grinning: