Coder Social home page Coder Social logo

-regex's Introduction

  • Thompson NFA is so fast!

https://swtch.com/~rsc/regexp/regexp1.html

  • https://emacs-china.org/t/topic/11860/4

      ("f\\(['\"]\\{1,3\\}\\)\\([^\\1]+?\\)\\1"
      (
       ;; "f\\(['\"]\\{1,3\\}\\)\\([^\\1]+?\\)\\1"
       "f\\(['\"]\\{1,3\\}\\)\\(.+?\\)\\1"
    

    Could you please clarify what you want to do past.

What this new regexp improve the previous version?

Thanks for you inspiration.

The previous version would not match an f-string like f'some {Arg} \n {arg2}'. It was also not doing what I thought. I thought [^\1] would be any character not matching the first group, but in fact it means do not match a \ or 1. The new regexp works like it should to fontify {arg}s inside f-strings.

I am sorry, I am new to regexp. And I am learning this with my friends who speed chinese.

I can not understand it right away.

I use this to understand it:

(re-search-forward "f\(['"]\{1,3\}\)\([^\1]+?\)\1" nil t)

I am guessing you are try to find this string

lkjciidsofwopvqi-something

in this string long string

flkjciidsofwopvqi-something

But I got:

Debugger entered--Lisp error: (invalid-read-syntax ") or . in a vector")
  read(#<buffer *scratch*>)
  elisp--preceding-sexp()
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

Looks like I am missing some context here.

  • matches two or more blank lines in sequence.

(re-search-forward "^\n\\{2,\\}")

  • match TODO

(re-search-forward "\\[TODO\\](\\([^\\)]+\\))" nil t)

  • match UUID

(re-search-forward "PDFNAME::\\([a-zA-Z0-9 \.\_\,\-]+\\)\.pdf - " nil t)

  • match page number

(re-search-forward "PAGENUM::\\([0-9]+\\)::END" nil t)

  • match secrete

(re-search-forward (concat arg "::\\(.*\\)"))

  • match @dfn{xxx}

(re-search-forward "@dfn{\\([^}]+\\)}" nil t)

  • match end sentence

(re-search-forward "[\.,;:!\?]" end t)

-regex's People

Contributors

randomwangran avatar

Watchers

 avatar  avatar

-regex's Issues

Weekly Digest (19 April, 2020 - 26 April, 2020)

Here's the Weekly Digest for randomwangran/-regex:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository randomwangran/-regex to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

Weekly Digest (3 May, 2020 - 10 May, 2020)

Here's the Weekly Digest for randomwangran/-regex:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository randomwangran/-regex to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

Weekly Digest (12 April, 2020 - 19 April, 2020)

Here's the Weekly Digest for randomwangran/-regex:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository randomwangran/-regex to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

Weekly Digest (26 April, 2020 - 3 May, 2020)

Here's the Weekly Digest for randomwangran/-regex:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository randomwangran/-regex to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.