validresponse regular expressions


Author
Message
lwise
lwise
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 10, Visits: 28
Perfect

Thanks so much for your prompt response

Lisa
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
Dave - Tuesday, March 7, 2017
lwise - Tuesday, March 7, 2017
I'm looking for an easy easy syntax to specify a valid response for any combination of four x's and four o's (i.e. an 8 letter string containing exactly four x and o in any pattern, without iterating through the possible patterns. 

Thanks
Lisa

You can specify a regular expression to match that pattern via an <openended>'s /mask attribute.

Alternatively, you can achieve a similar effect using /isvalidresponse and a couple of string functions:

<openended myopended>
/ charlimit = 8
/ isvalidresponse = [
    length(replaceall(tolower(openended.myopended.response), "x","")) == 4 &&
    length(replaceall(tolower(openended.myopended.response), "o","")) == 4
]
</openended>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
lwise - Tuesday, March 7, 2017
I'm looking for an easy easy syntax to specify a valid response for any combination of four x's and four o's (i.e. an 8 letter string containing exactly four x and o in any pattern, without iterating through the possible patterns. 

Thanks
Lisa

You can specify a regular expression to match that pattern via an <openended>'s /mask attribute.

lwise
lwise
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 10, Visits: 28
I'm looking for an easy easy syntax to specify a valid response for any combination of four x's and four o's (i.e. an 8 letter string containing exactly four x and o in any pattern, without iterating through the possible patterns. 

Thanks
Lisa
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search