Regular expression extension


#1

Hi there.
Here is my first extesion: Regular expression extension
The below photo explains what it can do.
Hope you like it.


and the aix:
cn.kevinkun.RegEx.aix (5.8 KB)


Textbox Validation of email id and mobile number in thunkable adnroid application
Extracting Text
How to extract numbers from incoming sms message
Replacing Text Ignoring Capitalisation?
Extract Text From Website
#2

Amazing!!! Good work!!!


#3

Could you explain what the patterns are? I don’t quite understand.


#4

Looks good! I have no idea what it al means, but I see you put a lot of work in it.

You should make a #tutorials on it, so people understand it more :slight_smile:

Great work!


#5

With this extention, it will be easier to deal with text/string.
for example, when you got the response from the web, if you want to get something from the table:

Please refer to below for what the patterns are:


#6

This looks great @kevinkun, I’m looking forward to trying it out.

If you get a chance you should come promote your new extension during #Thunkchat tomorrow:


#7

Well, thats a pretty great idea. I’ll try it as soon as possible.


#8

great to see more and more people creating extensions…
keep up the good work…

btw. my tools extension https://puravidaapps.com/tools.php already offers a Matches method, which uses regular expressions… I guess, I should make some more advertisement… :wink:

Taifun


#9

Hello, what regular expression can I use to capture the value before a word. For example: the weight is 250 kg (capture only 250). thank you


#10

@Cesar_Gomez what about using some simple blocks to get the value?
use the split at spaces block to split at the space to get a list of 2 items, then use the select list item block and select the first item
Taifun


#11

Are your incoming data well formed @Cesar_Gomez?
For example will it always have the space like “42 kg” or is it possible for your users to input 42kg?
What about capital letters or extra characters, e.g. 42Kgs etc?


#12

If you only want to get the number, you can use the getmatches block and “\d+” as pattern , you will get a list of all the numbers.


#13

Thanks, this is exactly what I was looking for.

FYI: This extension also works with AppyBuilder.


#14

So glad you like it.
And yes, it should work for all clone of app inventor.


#15

not working for me can u share block code


#16

The Regex I use is:

More info on RegEx(Regular Expression) here:


#18

Hi,
Can somebody tell me what is the pattern for searching several characters or words in a sentence and how to get indexs of the matches using this extension?
For example, I have these sentences " abdedzkpu" ,“abdedzkpu”
I want to search for the sentence that contains all of “a” ,“d”, “p”,
So the result must be the first sentence " abdedzkpu".
And if it is possible, I want to get all indexs in the sentence of “a” ,“d”, “p”. In this example, they’re 1 3 5 8.
Thanks
P/S: I’ve GG for my question, but haven’t gotten the answer yet, so I’m here to ask.


#19

Why do you expect that result? Both words contain these 3 letters?
You might want to prepare a better example and ask at stackoverflow.com, because there you will find the regex experts…
And before asking there first take the tour and read How to ask a good question

Taifun


#20

Thank you for your comment.
I have my own reason when I ask for that. Btw, as I said, I have Google for it many times before asking, and found some codes at Stackoverflow and Github…, but did not work in the way I want.

P/S: I will spend time on reading that instruction.
Big


#21

Sorry, I have just understood what do mean. It was a typing mistake in my question. They are not the same “words”. They are different. It must be something like this abdedzkpu and abdeyzkpu or something else.