www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Search for multiple RegExpressions in a text

  1. #1
    Join Date
    Dec 2008
    Posts
    2

    resolved [RESOLVED] Search for multiple RegExpressions in a text

    Hi Guru's out there, can someone help me with this problem? I have do find all the IMxxxxxxxxx strings in the following text, but I have no idea how to do that in javascript, some advice?

    Result should look like:

    IM002068218
    IM002068224
    IM002068235
    IM002068239

    Text to search through:

    Result=<?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://servicecenter.peregrine.com/PWS"><SOAP-ENV:Body><probsummaryGetListKeysResponse xmlns="http://peregrine.com/casm" docEngineRC="1" name="probsummary" query="assignment#&quot;CC OO&quot; and problem.status#&quot;Open&quot;" xsi:schemaLocation="http://peregrine.com/casm http://trapslang:42678/casm/probsummary.xsd"><keys><number sctype="string">IM002068218</number></keys><keys><number sctype="string">IM002068224</number></keys><keys><number sctype="string">IM002068235</number></keys><keys><number sctype="string">IM002068239</number></keys></probsummaryGetListKeysResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>;returnResult=<?xml version="1.0" encoding="UTF-8"?>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Contains an array of strings:
    Code:
    var str = Result.match(/IM\d{9}/gi);

  3. #3
    Join Date
    Dec 2008
    Posts
    2
    This solved my problem, TNX for this exellent answer!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles