Re: RegEx with phix - howto

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

I tried this using phix:

include builtins/regex.e 
regex_options( RE_PIKEVM ) 
regex_options( RE_EARLY_EXIT ) 
 
sequence line = `lorum ipsum lorum ipusm 10.1016.12.31/nature.S0735%20-1097(98)2000/12/31/34:7-7 lorum ipsum.` 
 
sequence rx = `(10(\.)(.* ))\b` 
 
sequence DOI = regex( rx, line ) 
? DOI 
 
if DOI = {} then 
    puts(1, "not found..." ) 
else 
    puts(1, line[ DOI[1] .. DOI[2] ] ) 
end if 
 
puts(1, "\n\n" ) 
 
--> 10.1016.12.31/nature.S0735%20-1097(98)2000/12/31/34:7-7 l 
 
-- ? where does the trailing `l` come from? 

Removing the trailing ` l` noise may not be too difficult.

_tom

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

Search



Quick Links

User menu

Not signed in.

Misc Menu