Re: RegEx with phix - howto

new topic     » goto parent     » topic index » view thread      » older message » newer message

First rule of regex: do not use regex.

Try something simple first.

include std/search.e 
 
sequence line = "lorum ipsum lorum ipusm 10.1016.12.31/nature.S0735%20-1097(98)2000/12/31/34:7-7 lorum ipsum." 
 
 
integer n, m 
 
n =  match( "10.", line ) 
? n  
 
if n then 
	m = find_any( " \t\r\n", line, n ) 
	? m 
	 
	if m then puts(1, line[n..m] ) end if 
 
end if 
-->  a `DOI` number 

_tom

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu