FAQ: Generic Regular Expression (regex) Formulas
-
Hello, and welcome to the FAQ Desk.
This post contains links to “generic” regular expressions (regex) developed and/or published in this Community, which can be easily used to accomplish certain tasks in regex search-and-replace situations.
And with no further ado:
List of Generic Regex
-
Replacing in a specific zone of text ⇒ useful for changing text between opening and closing tags
- Selecting a complete hierarchy between an opening HTML/XML tag and its corresponding closing tag ⇒ similar to the “specific zone”, but this variant allows nested hierarchies
-
Find a file that never contains a line that matches a specific expression
-
Logic Gates for Regular Expressions ⇒ shows how to use “and”, “or”, and other logical combinations in your regex
Using the Expressions
Most of these “generic” have some combination of “glue” which is required to be in the search or replace fields as-is, and “variables” which the end user is expected to enter a specific value for. For example,
glue|
VARIABLE|kraggle
; if you were searching forepoxy
with that formula, you would enterepoxy
instead of VARIABLE, so it will would likeglue|epoxy|kraggle
when you put it into the Find what field in the search or replace dialog.Adding to this FAQ
If you would like a new generic expression added here, make sure the expression has its own post someplace (a dedicated post for each regex in the “Blogs” category seems a good place). Giving example usages, and definitions of any of the VARIABLES, is essential to making it useful for other users. Then private-message one of the FAQ maintainers, including @PeterJones and @guy038 , or @-mention them in the Developing generic regex sequences topic, and they will work with you to get the generic expression description added to this FAQ.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-