kevinsteer
Posts: 4
Joined: Fri Jan 18, 2019 9:44 am

Capturing decimal numbers and email address with '.'

Tue Feb 26, 2019 1:51 pm

Hi,

I wish to capture decimal numbers (e.g. 2345.34) and email addresses (e.g. abc@xyz.com)

In the response whenever I enter the '.' it splits the pattern and initially returns 2345, then the next question 34

What is the best approach to capture input with a '.' ?

I am using the code
<Model>
<Pattern>FG-PROTECT</Pattern>
<Response>
<Switch User="Qindex">
<Case Value="FGPI1">
<Label>:FG-PROTECT-1</Label>
What is your current annual salary
<Think><User Set="Qindex">FGPI2</User></Think></Case>
<Case Value="FGPI2">
<Label>:FG-PROTECT-2</Label>
What is your current age
<Think><User Set="Qindex">FGPI3</User></Think></Case>
<Case Value="FGPI3">
<Label>:FG-PROTECT-4</Label>
How much have you saved to protect your income now
<Think><User Set="Qindex">FGPI1</User></Think></Case>
</Switch>
</Response>
</Model>

Capturing data entry

<Model>
<Pattern>*</Pattern>
<Previous>:FG-PROTECT-1</Previous>
<Response>
<Think>
<User Set="FGIncomeAnnual">
</User>
</Think>
<Goto>FG-PROTECT</Goto>
</Response>
</Model>

User avatar
Leslie
Lead Software Architect
Posts: 353
Joined: Fri Sep 14, 2012 12:20 pm
Contact: Website

Re: Capturing decimal numbers and email address with '.'

Tue Mar 05, 2019 10:10 am

Unlike SIML Modern, SIML Classic does have its own limitations.

A workaround this problem is to create a regular expression set and use it.

kevinsteer
Posts: 4
Joined: Fri Jan 18, 2019 9:44 am

Re: Capturing decimal numbers and email address with '.'

Thu Mar 14, 2019 8:03 am

Hi Leslie,
Thanks for your help,
I am not sure if I am using the Regular Expression in the Pattern, or the Label correctly.
I am testing update of email stored in a user setting, using the Email Regex below.

When I enter "UPDATE MY EMAIL",
I enter my email "abcd@xyz.com"
I get the response "Sorry, no response was generated."

Appreciate any help :)

<Regex Name="Email" Pattern="[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+" />

<Model>
<Pattern>UPDATE MY EMAIL</Pattern>
<Response>
<Label>:PERSONAL-EMAIL</Label>
Please enter your email
</Response>
</Model>

<Model>
<Pattern>@Email</Pattern>
<Previous>:PERSONAL-EMAIL</Previous>
<Response>
<Think>
<User Set="Email"> <Match /> </User>
</Think>
Your email is <User Get="Email" />
</Response>
</Model>

Return to “Report Bugs and Issues”

Who is online

Users browsing this forum: No registered users and 2 guests