rpaterick Posted December 19, 2012 Share Posted December 19, 2012 Seeing if this is possible? ex: RON CONLEY APARTMENTS 933 This would be OK to leave the 933 in the record. ex: RON CONLEY APARTMENTS 9334 ex: PEP BOYS 1407 4YD ex: 5806-TGC-280679-WEST CHICAGO I would like FusionPro to take out all of the numbers. Could be any combination of numbers and be anywhere in the cell placed. So basically if there are more than 4 numbers in the record, delete them. Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 19, 2012 Share Posted December 19, 2012 From the description, I think you mean "4 or more," i.e. "more than 3," not "more than 4." Anyway, this should do that: return Field("YourFieldName").replace(/\d{4,}/g,''); Quote Link to comment Share on other sites More sharing options...
rpaterick Posted December 19, 2012 Author Share Posted December 19, 2012 From the description, I think you mean "4 or more," i.e. "more than 3," not "more than 4." Anyway, this should do that: return Field("Full Name").replace(/[\<\>\/.]/g," ");Dan, Thanks for the quick reply(as usual:D). The code abover, how can I incorporate your code with this one? I'm not sure where to insert the addition of taking out the 4 or more numbers. Thanks Dan! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 19, 2012 Share Posted December 19, 2012 The code abover, how can I incorporate your code with this one? I'm not sure where to insert the addition of taking out the 4 or more numbers. return Field("Full Name").replace(/[\<\>\/.]/g," ").replace(/\d{4,}/g,''); Quote Link to comment Share on other sites More sharing options...
rpaterick Posted December 19, 2012 Author Share Posted December 19, 2012 return Field("Full Name").replace(/[\<\>\/.]/g," ").replace(/\d{4,}/g,''); Thanks Dan. I'm thinking of going in a different direction now. How can put in multiple formats of PHONE NUMBERS to be taken out? Example of different phone numbers that are formatted in the list. 847 695 3250 847-804-2108 5214626 How could I "build" up a code to put in different "#" scenarios(###-###-####, ###-####,(###)-###-####, etc..) that FusionPro would recognize and replace with nothing? Thanks Dan!! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 19, 2012 Share Posted December 19, 2012 How can put in multiple formats of PHONE NUMBERS to be taken out? Example of different phone numbers that are formatted in the list. 847 695 3250 847-804-2108 5214626 How could I "build" up a code to put in different "#" scenarios(###-###-####, ###-####,(###)-###-####, etc..) that FusionPro would recognize and replace with nothing? Well, I'm not sure I understand the ultimate goal. What else is in the data that shouldn't be replaced? Some specific examples of input and the corresponding desired output would help. That said, you should be able to do something like this: return Field("YourFieldName").replace(/\(?\b([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})\b/g, '');I got the regular expression here by Googling for "javascript match phone number": http://blog.stevenlevithan.com/archives/validate-phone-number#r4-2-v-inline Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.