Comments (8)
The correct regex to use here is /^.*\bftms?\b/i
. Use regex101.com if you want an explanation of how it works.
@saxamaphone69 That answer by ChatGPT is blatantly wrong in several ways (as LLM answers often are). Copy-pasting shitty AI generated answers you don't understand helps nobody.
from 4chan-x.
Give /^ftm/i
a go as I'm not sure if newlines even count when filtering. If you don't care where the "ftm" is, omit the ^
.
from 4chan-x.
just /^ftm/i didn't do anything
What am I supposed to do with the javascript regex. I entered the code (not sure if I did correctly cause I can#t see part of your image) and it blocked some of the ftm messages but most remained. No idea what was going on there
from 4chan-x.
The correct regex to use here is
/^.*\bftms?\b/i
. Use regex101.com if you want an explanation of how it works.
awesome, that worked but the explanation on regex101 confuses me because it doesn't state which part of it is responsible for selecting the line.
I noticed that I need it to filter line 2 and 3 as well
from 4chan-x.
the explanation on regex101 confuses me because it doesn't state which part of it is responsible for selecting the line.
^
means start of the comment..*
means a sequence of any characters EXCEPT for a newline\bftms?\b
is just "ftm" sorrounded by word boundaries, and with an optionals
at the end
Effectively this matches any string that starts at the start of the comment, ends with "ftm", and doesn't contain any newlines in between, so effectively just the first line.
If you want to match anywhere in the first 3 lines instead, you can use /^.*(\n.*){0,2}\bftms?\b/i
instead, but at that point I don't see why you wouldn't just filter in the entire comment.
from 4chan-x.
Effectively this matches any string that starts at the start of the comment, ends with "ftm", and doesn't contain any newlines in between, so effectively just the first line.
complicated...
If you want to match anywhere in the first 3 lines instead, you can use
/^.*(\n.*){0,2}\bftms?\b/i
instead, but at that point I don't see why you wouldn't just filter in the entire comment.
awesome!
it's because I'm trying to filter out ftm as a means to not have to interact with them but some bios contain "not looking for:ftm" at the end which would make me filter those out too if I didn't use your code.
from 4chan-x.
@bakugo all good, I have no idea how regex works and I find asking ChatGPT a good starting place, tweaking the bits I need, and doing more research from there. I then usually have regexr or regex1010 with an example of the comment/string I want to filter and tweak from there/ask ChatGPT for different options if I can't work it out on my own. I wasn't sure it was going to work for what was needed anyway and the fact that I forgot to ask it for "ftm" standalone, which is obvious now, doesn't help.
Glad you got your answer @ars4l4n, close the issue when you're ready.
from 4chan-x.
/^.*(\n.*){0,2}\bftms?\b/i
I use slightly changed versions of this and they work for the majority of things I wanted to filter but one thing still doesn't work.
I used: /^.*(\n.*){0,2}\bms?\b/i
and thought it should filter m
in line 1:
m
looking for
I'm just looking for someone to trauma dump on me, then leave
bonus points if you're literally insane because I'm having a boring night. Entertain me.
contact
_censored
I suspect that it's because m
is the only "word" in the line but I don't know for sure.
How do I solve this? Note that I don't want to filter the letter "m" when it's actually within a word
Also, how do I not filter 'm
such as in I'm
while still filtering /m/
or m
from 4chan-x.
Related Issues (20)
- 4chan removed IP counter from threads. I think they removed the API as well. HOT 4
- [Feature Request] Add an option to filter mass-reply posts. HOT 2
- [Feature Request] Contract by dragging to the right (firefox)
- [Feature Request] Resize webms/pictures/gifs exceeding user's window/certain resolution to fit constant size HOT 5
- Filtering only comments that don't have files in them HOT 1
- [Feature request] Resizable thread watcher and pushing replied threads to top
- Images don't load due to change on 4chan.org HOT 1
- How do exclude "no keyword" from filter?
- Error! The image was never in our databases.
- Downloading an image with the little button next to filename sometimes saves two copies, one corrupted
- Certain features don't work with Oneechan enabled
- Is it possible to add exceptions to filters?
- clipboard filesize bloat HOT 1
- 4chanx filter while JSON index is disabled
- an option to enable a button that randomizes filenames
- [captcha load broken] Uncaught DOMException: The quota has been exceeded.
- "Thread Hiding Buttons" initialization crashed. HOT 1
- Doesnt work on 4archive.org
- please delete this
- No captcha option, can't post. Error fetching archive data from https://mayhemydg.github.io/archives.json/archives.json Connection Error 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 4chan-x.