Delete Numbers

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
pranto1902
Posts: 7
Joined: Thu Aug 24, 2017 5:17 am

Delete Numbers

Post by pranto1902 » Sun Sep 09, 2018 8:13 am

Hello Again!

" VERSION BUILD=9030808 RECORDER=FX
Firefox 49.0.2
OS: Windows 10 Pro"

Well, let me ask my exact question.

I am extracting something from somewhere like a forum post.
And pasting it to other web.

Ah, While I paste that, I need to remove any number (0,1,2,3,4,5,6,7,8,9)

Example , blah blah blah...etc ete etc...contact me 123-345-6789

I want to extract only "blah blah blah...etc ete etc...contact me"

One thing that I want to clear those number only after pasting it..



Thanks for Helping ;)
chivracq
Posts: 8140
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Delete Numbers

Post by chivracq » Mon Sep 10, 2018 6:43 am

pranto1902 wrote:Hello Again!

Code: Select all

" VERSION BUILD=9030808 RECORDER=FX
  Firefox 49.0.2
  OS: Windows 10 Pro"
Well, let me ask my exact question.

I am extracting something from somewhere like a forum post.
And pasting it to other web.

Ah, While I paste that, I need to remove any number (0,1,2,3,4,5,6,7,8,9)

Example , blah blah blah...etc ete etc...contact me 123-345-6789

I want to extract only "blah blah blah...etc ete etc...contact me"

One thing that I want to clear those number only after pasting it..

Thanks for Helping ;)
:|
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
access2vivek
Posts: 36
Joined: Wed Dec 20, 2017 10:00 am

Re: Delete Numbers

Post by access2vivek » Sun Nov 04, 2018 10:59 am

You can get the extracted value in a variable and replace the variables using a regular expression as such.
Assuming that you have the value extracted in the !EXTRACT variable, you can do something like the following.

var temp = iimGetLastExtract(); // Storing the value of the last extract in a temporary variable.
temp = temp.replace(/[0123456789-]/g,""); // Removing all the numbers from the string.
iimPlayCode("TAG POS=1 TYPE=INPUT ATTR=* CONTENT="+temp); // Put the temporary value without numbers in the required location.

I hope it helps :-)
pranto1902
Posts: 7
Joined: Thu Aug 24, 2017 5:17 am

Re: Delete Numbers

Post by pranto1902 » Thu Dec 13, 2018 10:14 pm

access2vivek wrote:
Sun Nov 04, 2018 10:59 am
You can get the extracted value in a variable and replace the variables using a regular expression as such.
Assuming that you have the value extracted in the !EXTRACT variable, you can do something like the following.

var temp = iimGetLastExtract(); // Storing the value of the last extract in a temporary variable.
temp = temp.replace(/[0123456789-]/g,""); // Removing all the numbers from the string.
iimPlayCode("TAG POS=1 TYPE=INPUT ATTR=* CONTENT="+temp); // Put the temporary value without numbers in the required location.

I hope it helps :-)
Well Thanks Man... That works too... I found another solution before.. But this one works great <3
Post Reply