Matching text block.

A discussion of how to use EasyPatterns, EasyPattern Helper and using the EasyPattern library.

Moderator: DataMystic Support

evilowl
Posts: 2
Joined: Thu Apr 12, 2012 11:10 pm

Matching text block.

Postby evilowl » Thu Apr 12, 2012 11:15 pm

I need delete all lines till the end of html file after construction <div class="clear"></div>

Pattern

Code: Select all

<div class="clear"></div>[0+ char]

doesn't work - delete only "<div class="clear"></div>" but lines after still here..

Please help.

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Matching text block.

Postby DataMystic Support » Fri Apr 13, 2012 7:57 am

Code: Select all

<div class="clear"></div>[longest 0+ char]


EasyPatterns by default chooses the shortest text the matches the pattern, so you have to force it to choose the longest match.

You could also write:

Code: Select all

<div class="clear"></div>[0+ char, textEnd]


This forces '0+ char' to absorb all the characters in the file to allow textEnd to match
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

evilowl
Posts: 2
Joined: Thu Apr 12, 2012 11:10 pm

Re: Matching text block.

Postby evilowl » Fri Apr 13, 2012 2:56 pm

It works.
Thank you.


Return to “EasyPatterns Support”

Who is online

Users browsing this forum: No registered users and 2 guests