14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

464 Formula Functions Reference Appendix C<br />

Character Functions<br />

Shift, Shift Into<br />

Shift shifts an item or n items from the front to the back of the list or expression. Shifts items from back<br />

to front if n is negative. Shift Into shifts items in place.<br />

Reverse, Reverse Into<br />

Reverse reverses the characters in the string. Reverse Into reverses the characters in place.<br />

Concat Items<br />

Concat Items converts a list of string expressions into one string, with each item separated by a<br />

delimiter. The delimiter is a blank, if unspecified.<br />

Substitute, Substitute Into<br />

The first argument is a string, the second is a pattern, and the third is a replacement string. Substitute<br />

finds all matches to the pattern in the string, and replaces them with the replacement string. Substitute<br />

Into does the same substitution in place.<br />

Regex<br />

The first argument is the source string that Regex searches for a match to the pattern. The second<br />

argument is the pattern, in the form of a regular expression. The Formula Editor prompts you for these<br />

two required arguments.<br />

Tip: For more information about using regular expressions, search the Internet for regular expression<br />

tutorial.<br />

By default, Regex performs a case-sensitive search and returns the parts of the source string that match<br />

the pattern you specified (or returns MISSING if the match fails). There are two optional arguments<br />

that you can add. You can type a third argument—the format—that specifies the string to return. If you<br />

choose, you can use regular expressions to specify replacement text in the returned string. If you specify<br />

the third argument, you can also specify IGNORECASE so that Regex ignores capitalization when<br />

searching the source string for a match.<br />

Table C.1 Regex Examples<br />

Sample Regex function<br />

Regex( "@ q3 #", "([a-z])([0-9])" )<br />

String that is returned<br />

q3<br />

The function is case sensitive, so q3 matches but<br />

Q3 would not.<br />

Regex( "@ Q3 #", "([a-z])([0-9])",<br />

"\0",IGNORECASE)<br />

Regex( "@ Q3 #", "([a-z])([0-9])",<br />

"\2\1",IGNORECASE)<br />

Q3<br />

Although \0 is the default argument, it is required<br />

in this example so that IGNORECASE can be<br />

specified.<br />

3Q

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!