ICONICO

Discussion Thread

Data Extractor

Message Thread

For WindowsData Extractor

Data Extractor iconExtract any data, including email addresses and URLs from your files and webpages.

Posted in the Data Extractor Forum.




How to apply 'non-greedy' to Regular Expression?

I've created the following Pattern based Rule (no Match Case):

(href|src)="?.*\.(js|css)"?

The ? at the end is suppose to make the preceding quote non-greedy.

I then apply it to the following 4 lines of text:

<script type="text/javascript" src="repertoire/highslide-with-gallery.js"> </script>
<script type="text/javascript" src="repertoire/highslide.config.js" charset="utf-8"> </script>
<link rel="stylesheet" type="text/css" href="repertoire/highslide.css" />
<link rel="stylesheet" href="ccb-moz-php.css" type="text/css" />


with the following 1 line result:

src="repertoire/highslide-with-gallery.js"> </script>
<script type="text/javascript" src="repertoire/highslide.config.js" charset="utf-8"> </script>
<link rel="stylesheet" type="text/css" href="repertoire/highslide.css" />
<link rel="stylesheet" href="ccb-moz-php.css"

-----------------------------------------------------------------------
using the same input and rule at

Http://www.regexplib.com/RETester.aspx

results in:

src="repertoire/highslide-with-gallery.js"
src="repertoire/highslide.config.js"
href="repertoire/highslide.css"
href="ccb-moz-php.css"

Which is the desired result.

-----------------------------------------------------------------------
How do I change Data Extractor's Greedy search into a Non-Greedy search so I can get meaningful results.

Thanks,
Marc
by Marc User on Sep 30 2012 8:03pm Reply

Our Software Stores

IconicoAccurate Design and Development Software

BitsDuJourDiscount Deal Coupons for Windows and Mac Software Apps

Our Software Services

IcoBlogOur Official Blog

© copyright 2004-2024 Iconico, Inc. Code & Design. All Rights Reserved. Terms & Conditions Privacy Policy Terms of Use Login