Giter Site home page Giter Site logo

Regular expressions about f2 HOT 12 CLOSED

ayoisaiah avatar ayoisaiah commented on June 19, 2024
Regular expressions

from f2.

Comments (12)

zz0rk avatar zz0rk commented on June 19, 2024 1

Man, this is weird. I don't have anything fancy.
image
image

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

No, you should enclose the find expression in quotes:

$ f2 -f '((.*?))' -r '-'

from f2.

zz0rk avatar zz0rk commented on June 19, 2024

Thank you for your reply.

I am trying to match a pair of parenthesis and everything inside it, see

https://github.com/ayoisaiah/f2/wiki/Regular-expressions
((.*?)) Match a pair of parenthesis and everything inside

The above syntax will generate
bash: syntax error near unexpected token `('

Your suggestion in your reply from above will generate
f2 -f '((.*?))' -r '-'
INFO Failed to match any files

In this case
'Test (some text)' will remain unchanged when the expectation was for it to be changed to
'Test -'

Thank you

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@zz0rk You need to escape the outer parentheses:

image

from f2.

zz0rk avatar zz0rk commented on June 19, 2024

f2 -f '((.*?))' -r '-'
INFO Failed to match any files

I don't know what I am doing wrong here

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

You're not including the backslash:

$ f2 -f '\((.*?)\)' -r '-'

from f2.

zz0rk avatar zz0rk commented on June 19, 2024

I've been copying and pasting the command directly from your comment into my terminal and also typed it manually. Same result.
image

I have noticed that when I preview this comment the backslash gets removed, so in fact the syntax I've been using was correct, but didn't pay attention that when the comment get's posted the backslash gets removed.

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@zz0rk That's weird, I'm unable to reproduce. What version of f2 are you using?

from f2.

zz0rk avatar zz0rk commented on June 19, 2024

I am running a current version of Debian 11. I've tested on a second box and I am getting the same results. I can upgrade to the latest version of F2 later today, but the version I am running right now doesn't work.

image

from f2.

zz0rk avatar zz0rk commented on June 19, 2024

Curiosity got the better of me... still no dice
image

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

I just tested on Debian 11, same result for me. Are you using bash or some other shell?

image

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

I'm going to close this issue, because I couldn't reproduce it on of my setups.

from f2.

Related Issues (20)

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.