Directory: strings/
This directory contains routines useful for handling strings.
The DLM contains some wrappers to the TRE regular expression engine.
All the matches in a string can be found using the ALL
keyword:
IDL> s = 'ii j i iiii jj ii'
IDL> print, mg_stregex(s, 'i+', /all, /extract)
ii i iiii ii
APPROXIMATE
keyword:
IDL> s = 'mike mjke Mike Mjke'
IDL> print, mg_stregex(s, 'mike', /approx, /all, max_cost=1, /extract)
mike mjke Mike
Contents
.pro files
- mg_newline.pro
Returns the newline separator(s) for the OS: linefeed on UNIX platforms and carriage return/linefeeds for Windows.
- mg_reads.pro
- mg_spellcorrect.pro
Returns the correct spelling of the given word.
- mg_stregex.pro
Wrapper for STREGEX which includes a FIND_ALL keyword to find all occurrences within a scalar string.
- mg_streplace.pro
Handle string replacment with regular expressions.
- mg_string__define.pro
Class representing a string and an example of using operator overloading available in IDL 8.0.
- mg_strmerge.pro
Merges a string array into a single string separated by carriage return/linefeeds.
- mg_strunmerge.pro
Splits a scalar string with newline characters into a string array.
- mg_strwrap.pro
Wrap a string into a character width limit space.
- mg_subs.pro
String substitution routine which substitutes values into a given string using the correspondences found in the provided hash or structure.
Contact me if you have enhancement requests or bug fixes.