Open GoogleCodeExporter opened 8 years ago
I have reformulated the question so maybe it is more understandable:
I have a language that can basically be in the next form:
ROOT+S36+S35+S34.......+S15+S14.........+S2+S1
but there are restrictions that make the root appear with only some suffixes
and not with all the 36, for instance:
[ ~$[S36 ?* [S20|S12|S2]]; ! S36 can not combine with S20, S12 or S2
[S14 => ?* _ ?* S7 ?*]; ! Every time that S14 appears, S7 must also appear
[[S10 => ?* S12 ?* _ ?* S8] | [S10 => ?* _ ?* S7 ?*]]; ! Every time S10
appears, it must appear either between S12 and S8, or with S7
etc.
and here comes the one I don't know how to express in regex:
! Every time the sequence [?* S36 ?* S20 ?* S5 ?*] appears, it must appear S8
between S20 and S5, like this: [?* S36 ?* S20 ?* S8 ?* S5 ?*]
That is the question, and thanks again......
Original comment by andreschandiaf
on 20 Mar 2015 at 9:34
First, this part:
[S10 => ?* S12 ?* _ ?* S8] | [S10 => ?* _ ?* S7 ?*]
should probably read:
[S10 => S12 ?* _ ?* S8 , _ ?* S7]
(that's how two contexts are specified; also you don't need ?* at edges)
The actual question is: when you see ?* S36 ?* S20 ?* S5 ?*, S8 must appear
between S20 and S5. This seems like it's doable without context restriction,
like so:
~$[?* S36 ?* S20 ~$S8 S5 ?*]
Original comment by mans.hul...@gmail.com
on 21 Mar 2015 at 3:03
Ok, thanks a lot for the two things, great! I see it now!
Original comment by andreschandiaf
on 21 Mar 2015 at 3:10
Original issue reported on code.google.com by
andreschandiaf
on 19 Mar 2015 at 7:31