Community
    • Login

    FAQ: Generic Regular Expression (regex) Formulas

    Scheduled Pinned Locked Moved FAQ
    regexfaq
    1 Posts 1 Posters 2.8k Views
    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.
    • PeterJonesP
      PeterJones
      last edited by guy038

      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

      • How to use the couple of “Backtracking Control” verbs (*SKIP)(*FAIL) or (*SKIP)(*F) ⇒ usefull to easily identify what should be skipped and what should be matched.

      • 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 3
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • Alan KilbornA Alan Kilborn referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • Alan KilbornA Alan Kilborn referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • Lycan ThropeL Lycan Thrope referenced this topic on
      • PeterJonesP PeterJones referenced this topic on
      • Terry RT Terry R referenced this topic on
      • mkupperM mkupper referenced this topic on
      • mkupperM mkupper referenced this topic on
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors