Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
StringTools[RegSubs] - perform regular expression substitutions
Calling Sequence
RegSubs( env, text )
Parameters
env
-
string = string; substitution to make
text
string; text to substitute into
Description
The RegSubs(env,text) command replaces each occurrence of a substring matching the left-hand side of env with the right-hand side of env in the string text.
If no substring of text matches the left-hand side of env, then text is returned unchanged.
This procedure is closely related to StringTools[RegSub], but provides a more intuitive interface. The chief difference between the two is that RegSubs effects all relevant substitutions (serially), while StringTools[RegSub] performs a single substitution. Also, the left-hand side of env cannot match an empty substring of text. (An exception is raised in this case.)
Examples
See Also
Regular_Expressions, string, StringTools, StringTools[RegMatch], StringTools[RegSub], StringTools[Substitute], StringTools[SubstituteAll]
Download Help Document