Loading...
Items are delimited by single line break other.  
Skip empty.   Display only if options.  

Tool: Insert prefix and/or suffix into each line/item.

Purpose: Insert a prefix and/or suffix into each line or delimited item of text with the option to control insertion using only if matching.
Instructions: Load working-text, select other delimiter* option if needed, enter prefix and/or suffix into their appropriate field and click "Insert prefix and/or suffix" button. Check "Skip empty" to skip inserting a prefix/suffix into empty lines/items. Check only if checkbox to open only if matching controls. *See other delimiter example.
only if matching: only if matching will control tool operation based upon the only if text being contained or not contained within the working-text iterations within tool's function. For this tool only if will control whether or not a prefix/suffix will be applied to the line or delimited item. only if matching can contain a "regular expression" (regex) giving the ability to match multiple items.
Regex instructions: A "regular expression" (regex) is a sequence of characters defines a search pattern within a matching action. Within a regex phrase are literal and special characters of which the special characters define what actions are to be done. Special characters []{}().*+?^=!:$\| will function as literal characters when escaped with a single backslash. Use the "Enter literal find text to escape special characters" tool at page bottom to escape a mix of literal and special characters used as literals.
Regex examples: Be sure to check "Display only if options" and "Allow regex matching in only if field" for these examples to work.

Match if either ("a" or "b" or "c") are in line.

Working-text is:

abcd
xyz
acef


Enter p- in prefix field and -s in suffix field. To match if either ("a" or "b" or "c") are within lines, check containing button, enter regex phrase a|b|c into "this text", click "Insert prefix and/or suffix" button and result will be:

p-abcd-s
xyz
p-acef-s


Check "not containing" button for inverse result.



Match if either ("a" and "b" and "c") are in line.

Working-text is:

abcd
xyz
acef


Enter p- in prefix field and -s in suffix field. To match if either ("a" and "b" and "c") are within lines, check containing button, enter regex phrase (?=.*a)(?=.*b)(?=.*c) into "this text", click "Insert prefix and/or suffix" button and result will be:

p-abcd-s
xyz
acef


Check "not containing" button for inverse result.



Other delimiter example:

Working-text is:

a,b,c,d

Enter p- in prefix field and -s in suffix field, click "other" button, enter delimiter , click "Insert prefix and/or suffix" button and result will be:

p-a-s,p-b-s,p-c-s,p-d-s