Instead of using the regex expression (<.+>) in your pattern matching
expression, use the appropriate pattern matching expression instead.
There are various problems with the regex facilities in the current
implementation. A new proposed version has been submitted but is
undergoing testing to ensure that it doesn't make a mess of other
facilities in unicon. The new proposed version has some
incompatibilities with the features of regex as documented in the unicon
reports.
regards
Bruce Rennie
On 31/12/17 05:02, Yves Cloutier wrote:
Hi again,
When trying to match a simple pattern:
title := "<TITLE>" || (<.+>) -> capture || "</TITLE>"
if text ?? title then write("\chapter{", capture, "}")
I get the following error:
|"pattern_assign_onmatch": invalid argument for unary operator|
After some fiddling around I managed to clear the error by adding parens to my regular expression:
<(.)+> instead of (<.+>)
It's working to some degree, but I'm not getting the results I has hoping. I will need to have anther look at the html source and reassess my aproach. The html is not as clean as I initially thought.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I committed (to Unicon's SVN repository) a preliminary fix for the missing
<.+> code this evening. Perhaps the interesting part was that before my
fix, the error message I got was different from the one you got. Thanks for
the report. We are close to the point where, with the patterns and their
regex literals, we can write most programs shorter, faster, and more
readable than with just string scanning. But, the two are not mutually
exclusive and string scanning is not going away...ever.
After some fiddling around I managed to clear the error by adding parens
to my regular expression:
<(.)+> instead of (<.+>)
It's working to some degree, but I'm not getting the results I has hoping.
I will need to have anther look at the html source and reassess my aproach.
The html is not as clean as I initially thought.
Hi again,
When trying to match a simple pattern:
I get the following error:
which references this line:
What I'm trying t do is assign anything in between <TITLE> and </TITLE> to a variable.
To my knowledge I seem to be following the correct syntax, but it seems not!
Last edit: Yves Cloutier 2017-12-30
Good morning Yves,
Instead of using the regex expression (<.+>) in your pattern matching
expression, use the appropriate pattern matching expression instead.
There are various problems with the regex facilities in the current
implementation. A new proposed version has been submitted but is
undergoing testing to ensure that it doesn't make a mess of other
facilities in unicon. The new proposed version has some
incompatibilities with the features of regex as documented in the unicon
reports.
regards
Bruce Rennie
On 31/12/17 05:02, Yves Cloutier wrote:
Hi Bruce,
After some fiddling around I managed to clear the error by adding parens to my regular expression:
<(.)+>
instead of(<.+>)
It's working to some degree, but I'm not getting the results I has hoping. I will need to have anther look at the html source and reassess my aproach. The html is not as clean as I initially thought.
Hi Yves,
I committed (to Unicon's SVN repository) a preliminary fix for the missing
<.+> code this evening. Perhaps the interesting part was that before my
fix, the error message I got was different from the one you got. Thanks for
the report. We are close to the point where, with the patterns and their
regex literals, we can write most programs shorter, faster, and more
readable than with just string scanning. But, the two are not mutually
exclusive and string scanning is not going away...ever.
Cheers,
Clint
On Sat, Dec 30, 2017 at 8:04 PM, Yves Cloutier cloutiy@users.sf.net wrote:
Great, thanks for looking into it Clint