Groovy web console

subscribe to the feed Subscribe
to this
site
groovy regex (via #groovywebconsole)
tweet this snippet Tweet
this
script

groovy regex

Published 4 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def chipDetails = 'CHIP_DETAILS:1234-A0;1456-B1;2456-B0;3436-D0;4467-C0'  
def testArray = ( chipDetails =~ /(?<=[:;])\d*(?=[-])/) 

testArray.each{
    println it
}