[rules-users] Regular expression problem in .dsl

FrankVhh frank.vanhoenshoven at agserv.eu
Thu Dec 1 09:23:12 EST 2011


Hi,

The placeholder will just be replaced by whatever the user input is, there
is no need to do those String operations.

In your dsl, copy your DRL and replace everything that is user input by
{keyword}. Nothing else has to be done.

Regards,
Frank


fiitkar wrote
> 
> Hello,
> 
> I have a problem how to define the proper regular expression in .dsl file,
> LHS part, when searching a string with a defined input character.
> 
> Before I used .drl file, the rule looks like:
> plan : Plan( item matches "S.*|.*[^#]S.*" ) - that's OK. So it matches an
> input with S, but not #S - that is not the point...
> 
> But how to define it in .dsl file?
> Keep in mind that character "S" comes from the user, so it have to be
> merged with my regular expression.
> 
> I tried it that way:
> [condition][]There is a Plan with item1 {inputCharacter}=$Plan : Plan(item
> matches {inputCharacter} + ".*|.*[^#]" + {inputCharacter} + ".*"  )
> 
> But I got compilation error: mismatched token ....
> So I want to create a regular expression using the input character.
> I use Drools 4.0.7
> 
> Regards,
> Peter
> 


--
View this message in context: http://drools.46999.n3.nabble.com/Regular-expression-problem-in-dsl-tp3551037p3551706.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list