Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    FAQ Desk: Generic Regular Expression (regex) Formulas

    FAQ
    regex
    1
    1
    838
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PeterJones
      PeterJones last edited by PeterJones

      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 for epoxy with that formula, you would enter epoxy instead of VARIABLE, so it will would like glue|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.

      1 Reply Last reply Reply Quote 2
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  Alan Kilborn Alan Kilborn 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  Alan Kilborn Alan Kilborn 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • Referenced by  PeterJones PeterJones 
      • First post
        Last post
      Copyright © 2014 NodeBB Forums | Contributors