Regular expressions to parse address fields needed

Questions, tips and tricks and techniques for scripting in Servoy

Regular expressions to parse address fields needed

Postby DFehrenbach » Mon Feb 23, 2004 8:12 pm

I am converting a FMPro data file over to Servoy. One of the text fields includes soft carriage returns in an address field. In my Servoy file I have two address fields. On loading the Servoy file I want to determine if the input address field contains a Hex(0B) character and if so add all characters to the left of it to Address1 and the remaining characters to Address2. Can anyone help me out?
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH

Postby Jan Blok » Tue Feb 24, 2004 3:18 pm

var index = stringvalue.indexOf(0,'\x0B')
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby DFehrenbach » Thu Feb 26, 2004 5:37 pm

Thanks Jan. It worked for me, but not the first time. The order of the arguments must be reversed. For others that might be following this, the correct syntax is:
var index = stringvalue.indexOf('\x0B',0)
DFehrenbach
 
Posts: 252
Joined: Sat Sep 13, 2003 6:48 pm
Location: Cleveland, OH


Return to Methods

Who is online

Users browsing this forum: No registered users and 22 guests