question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regular expression of Clojure's Code Tree

See original GitHub issue

Regular expression of Clojure’s Code Tree, It can display all defined functions and variables.


(?x)
 (^(\(\s*(def[^\{\}\[\]\(\)\^\.\s:#@/\\']*))\s+(\^.*)*\s*(\^\{[^{}]+\})?\s*[^\{\}\[\]\(\)\^\.\s:#@/\\']+([\(\)\[\]\s \t]$))
|(^(\(\s*(def[^\{\}\[\]\(\)\^\.\s:#@/\\']*))\s+(\^.*)*\s*(\^\{[^{}]+\})?\s*([-[:alnum:]*+!_:\/.?]+))
|(\(\s*intern\s+(\^.*)*([-[:alnum:]*+!_:\/.?]+))

This regular expression is valid when applied in the function list of notepad++. display effect:


(def  x1
(def x2
(defn f1
(defn- f2
(defmacro m1
(defhtml html01

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Alexey-Tcommented, Oct 11, 2020

Applied this fix. pls test.

1reaction
Alexey-Tcommented, Oct 11, 2020

Ok, it is good look now. note about regex:

  • - in [] must be escaped to not make the range (it will not be range \w- but better escape)
  • (def\w*)|(ns) - no need in brackets here
  • after def\w* and ns must be space? then use \s+
  • why (?r), you need national word chars in \w?

attache the .lcf file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

19 Strings and Regular Expressions - Clojure
A "regex" is a string which defines a search pattern for other strings. Clojure uses the same Java regular expression abstraction while offering...
Read more >
Regular Expressions · Practicalli Clojure
Regular expressions are a powerful and compact way to find specific patterns in text strings. Clojure provides a simple syntax for Java regex...
Read more >
Regex Optimization in Clojure - camdez
Instead, we can compute an optimized regular expression where the A is only matched once and only then do we continue on to...
Read more >
re-pattern - clojure.core - ClojureDocs
Returns the next regex match, if any, of string to pattern, using java.util.regex.Matcher.find(). ... ... Replaces all instance of match with replacement in...
Read more >
Structure and Interpretation of Malli Regex Schemas - Metosin
Most developers are probably familiar with regular expressions of strings and their basic forms. Here they are in (JVM) Clojure and Malli forms:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found