Regex in groovy

Groovy Language enhancements that help with Regex Slashy Strings is the first thing that comes to my mind while talking about regex in Groovy. They are a simpler way to represent regex patterns as String compared to their Java counterparts. If we have to find all numbers in a String we can do something like this in Java [code] ...

by Aseem Bansal
Tag: regex


Logentries – Search and Analysis using RegEx named capture group

Most of us would be using some tools for centralizing logs, their analysis and storage. Logentries is also the one falling into this category. Logentries provides a straightforward way for analysis of logs containing KVPs i.e. Key-Value pairs. But for the cases where KVPs are not present it becomes quite hectic to analyse the logs. ...

by Navjot Singh
Tag: regex


Replace All using JQuery and Regex

I recently found out that use of Regex with jQuery and replace function can turn out to be a very powerful tool for replacing/loading data in html dynamically The use of replace is made like [js] var a = "Some text here text"; a=a.replace(/text/g,"one") [/js] This will replace all "text" with "one" Now...

by Gaurav Sharma
Tag: regex


Regex to match exact word in a string

Hi, In my recent grails project, i needed to check the occurrence of a word in a string. I could have used contains() method of groovy , but the problem with contains() is that it also matches the word if the word is contained as a substring in any word. I searched a lot, but nothing worked out so i decided to use Regular expression...

by Vishal Sahu
Tag: regex