Skip to Content

RegEx and JavaScript Mathematical Tool

If you know me…you already know I love programming languages and new tools. While Regular Expressions and JavaScript are not exactly new, they haven’t been exploited in ABAP, that’s why I want this blog to show of the things we can perform by using either of the great language additions.   The story so far is this…I was checking my Google Reader like all mornings, when I saw this funny and great XKCD comic strip  (…    image I knew it was my time to try to became an RegEx hero…  Let’s say that RegEx is not easy…it’s sometimes cryptic and greedy…but believe me…you came to love it (Ok…not everyone loves it…)  So, I knew it was time for me to build a small tool using my new learned skills. So I build an small Mathematical tool, by using both RegEx and JavaScript…and the funny thing here is that while I was breaking my head with RegEx, I remembered that by using JavaScript I just had the work almost done…but as I’m a Geek…I just couldn’t go the easy way…I keep fighting till I make my RegEx work but keep the JavaScript as a way to say…”there’s more that one way to make things work…”.  Let me show you some pictures first, and the I’m going to post the source code…   imageWe can pass a very simple expression…imageOr a very complex expression…imageAnd test it both in JavaScript or in RegEx…image
You must be Logged on to comment or reply to a post.