Comments (4)
I believe I've verified it is iTerm2's doing, not vim's.
Running this in my shell:
echo '\x1b[0;38;5;121mwidth\x1b[0m:\x1b[0;103m100%\x1b[0m;'
Gives me this back when copied:
�[0;38:5:121mwidth�[0m:�[0;111m100%�[0m;
I'm curious to hear what you think.
from ansi-regex.
Correct me if I'm wrong but this has nothing to do with the ansi-regex
node.js package.
from ansi-regex.
Well, it might? Like I said, I'm not an expert. Is that valid ANSI or not? The regex doesn't match on it.
Is it or isn't it the purpose of this package to match on ANSI escape codes?
from ansi-regex.
It's just that you didn't provide any code to indicate you're even using this library.
> s ='\x1b[0;38;5;121mwidth\x1b[0m:\x1b[0;103m100%\x1b[0m;'
'\x1B[0;38;5;121mwidth\x1B[0m:\x1B[0;103m100%\x1B[0m;'
> r = new RegExp(pattern, 'g')
/[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g
> r.exec(s)
[
'\x1B[0;38;5;121m',
index: 0,
input: '\x1B[0;38;5;121mwidth\x1B[0m:\x1B[0;103m100%\x1B[0m;',
groups: undefined
]
> r.exec(s)
[
'\x1B[0m',
index: 18,
input: '\x1B[0;38;5;121mwidth\x1B[0m:\x1B[0;103m100%\x1B[0m;',
groups: undefined
]
> r.exec(s)
[
'\x1B[0;103m',
index: 23,
input: '\x1B[0;38;5;121mwidth\x1B[0m:\x1B[0;103m100%\x1B[0m;',
groups: undefined
]
> r.exec(s)
[
'\x1B[0m',
index: 35,
input: '\x1B[0;38;5;121mwidth\x1B[0m:\x1B[0;103m100%\x1B[0m;',
groups: undefined
]
> r.exec(s)
null
Seems like it works fine.
Can you show some code?
from ansi-regex.
Related Issues (20)
- The fat arrow does not work in IE HOT 1
- does not work ie11 HOT 1
- IE problem HOT 1
- escape codes from `ansi-escapes` not being stripped by `strip-ansi`? HOT 4
- Set title mode escape codes not matched
- Allowing regex to match only first HOT 2
- developmemt HOT 3
- Does not work on terminal-link HOT 2
- fetchMetadata: sill resolveWithNewModule [email protected] checking installable status HOT 1
- IE11 not supported HOT 1
- Self-signed Certificate HOT 1
- Can't match cursorSave and cursorRestore HOT 3
- Backport of security patch, for benefit of yargs HOT 30
- Tests break (tsd) HOT 1
- Tests for CVE-2021-3807 HOT 2
- Error [ERR_REQUIRE_ESM]: Must use import to load ES Module HOT 3
- Yarn audit fails due to vulnrability HOT 1
- React [CRA] - Don't work with 5.0.1 HOT 2
- 【正则匹配不全】 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansi-regex.