mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2011
Posts: 53
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
Hi, this is the existing script:

Code:
	<parseinfo>
		<linepatterns>
			<extract>
				<!--New Article: <article> - Type: News (PDF) - linked by: James - http://example.org/details.php?id=61713&hit=1-->
				<regex value="^New Article:\s*(.*)-\s*Type:\s*([^\(\-]*).*-\s*linked by:\s*(.*)-\s*https?\:\/\/([^\/]+\/).*[&amp;\?]id=(\d+)"/>
				<vars>
					<var name="ArticleName"/>
					<var name="category"/>
					<var name="format"/>
					<var name="$baseUrl"/>
					<var name="$ArticleId"/>
				</vars>
			</extract>
		</linepatterns>
		<linematched>


The announce is in two formats, either 'New Article' or 'New Clipping'. I'd like to match both announces in the above script if possible.

How do I modify the above regex to match 'New Clipping' as well as the existing 'New Article'?

Thank you

Last edited by sandygws; 26/08/13 12:46 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
This is not a (mirc) script. And so beyond matching "New Article" or "New Clipping" which is in itself super easy, I have no idea what you want.

Joined: May 2011
Posts: 53
S
Babel fish
OP Offline
Babel fish
S
Joined: May 2011
Posts: 53
There is an .mrc file which sits between the script above and the actual mirc client. That functions fine, but I am unsure how to match both of those two terms in the same script .. even if it is 'super easy'!


Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
In regex you use (Article|Clipping) to match either text. It looks like the script is passing $regml to the list of vars you have, the variable names don't quite match what I think the regex is capturing though. If that's how it works you may need to use a noncapturing group for the regex so your vars don't get messed up: (?:Article|Clipping)

If you want to know if it was either an article or clipping you would not use the noncapturing group and you would add a new var for it to be stored in.

Last edited by Loki12583; 26/08/13 03:28 AM.

Link Copied to Clipboard