PeopleSoft Regular Expressions

From TekiWiki

Jump to: navigation, search

This whole wiki has now moved to http://www.springboardsolutions.com/wiki

Go to this page PeopleSoft Regular Expressions

(Created page with "Regular Expressions can be used in PeopleSoft PeopleCode by using PeopleCode support for Java. The following does a text replacement: Local JavaObject &text; Local ...")
(→Checking the Format)
 
Line 1: Line 1:
[[Regular Expressions]] can be used in [[PeopleSoft]] [[PeopleCode]] by using PeopleCode support for Java. The following does a text replacement:
[[Regular Expressions]] can be used in [[PeopleSoft]] [[PeopleCode]] by using PeopleCode support for Java. The following does a text replacement:
-
 
+
<pre>
Local JavaObject &text;
Local JavaObject &text;
Local JavaObject &expression;
Local JavaObject &expression;
Line 12: Line 12:
&text = &converter.ReplaceAll("Replacement");
&text = &converter.ReplaceAll("Replacement");
 +
</pre>
 +
 +
'''CreateJavaObject''' - creates the Java String object with the text to feed to the Regular Expression then referred to by &text.
 +
 +
'''GetJavaClass''' - refers to the Pattern Java class statically so that it can run the compile method.
 +
 +
This trick can be used with any Java class you want to use in PeopleCode.
 +
 +
==Uses of Regular Expressions in PeopleCode==
 +
 +
===Checking the Format===
 +
The Custom Field Formatting of PeopleSoft is great for certain types of format checking and changing. It is ideal for reformatting phone numbers for example.
 +
 +
Regular Expressions however provide a large number of additional possibilities that will allow sophisticated checks to be made with a very small amount of code.
 +
 +
===Text Processing===
 +
[[Regular Expressions]] also allow text processing that would take many Find, Substitute, Replace and SubString commands.
 +
 +
==More information on Regular Expressions==
 +
 +
Regular expression calculator:  [http://www.homemarketeer.com/sbs/regular_expression.html Regular Expression Calculator]
 +
 +
Regular expression information: [http://www.homemarketeer.com/sbs/regexp.htm Regular Expression Information]

Latest revision as of 18:47, 19 January 2016

Personal tools