Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex filter for .steam auto-reply. #1

Open
Synthlight opened this issue Sep 30, 2020 · 0 comments
Open

Regex filter for .steam auto-reply. #1

Synthlight opened this issue Sep 30, 2020 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Synthlight
Copy link
Collaborator

Synthlight commented Sep 30, 2020

I'm keeping this open as an ongoing issue. If there are new things to add, or false positives that need fixing, add a comment.
The regex & issue will be updated, and the comments merged/deleted into this issue. Keeps things clean.

// A var since I keep copying the "the game", "it", "this", etc in many of these.

const theGamePart1 = `(that|the|this)`; // The 'the' part of 'the game'. The group of words that patch the first part.
const theGamePart2 = `(game|it|volcanoid(s?))`; // The 'game' part of 'the game'. The group of words that patch the last part.

// Merge so we either match: The first part, the second part, or both parts.
// e.g. we match: 'the', 'the game', or 'game'.
// Breakdown:               'the'     |     'game'    |            'the game'
const theGameRegex = `(${theGamePart1}|${theGamePart2}|${theGamePart1}\\s${theGamePart2})`;

const steamAutoreplyRegex = CreateAutoReplyRegex([
    `when(('|’)s|s| is)?( ${theGameRegex})? (come|coming) out`,
    `is ${theGameRegex} (out|released|available)( yet)?`,
    `is ${theGameRegex} (up|available) (yet|to download)?`,
    `(where|how) (can|do|does)( [^ \\n]+?)? (get|buy|play) (this|it|${theGamePart1} ${theGamePart2})`,
    `(where|how).*?download`),
    `(is|if|will)( [^ \\n]+?)? ${theGameRegex}( (?!only)[^ \\n]+?)? (free|on steam)`,
    `what.*?(get|buy|is)( [^ \\n]+?)? ${theGamePart2}.*? on[^a-zA-Z]`,
    `how mu(t?)ch .*?${theGameRegex}? cost`,
    `how (much|many)( [^ \\n]+?)? is ${theGameRegex}`,
    `can i play( [^ \\n]+?)?( ${theGameRegex})? now`,
    `price in (usd|dollars|aud|cad)`
], `igm`);

The generated result:
(when(('|’)s|s| is)?( ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))? (come|coming) out)|(is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) (out|released|available)( yet)?)|(is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) (up|available) (yet|to download)?)|((where|how) (can|do|does)( [^ \n]+?)? (get|buy|play) (this|it|(that|the|this) (game|it|volcanoid(s?))))|((where|how).*?download)|((is|if|will)( [^ \n]+?)? ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?)))( (?!only)[^ \n]+?)? (free|on steam))|(what.*?(get|buy|is)( [^ \n]+?)? (game|it|volcanoid(s?)).*? on[^a-zA-Z])|(how mu(t?)ch .*?((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?)))? cost)|(how (much|many)( [^ \n]+?)? is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))|(can i play( [^ \n]+?)?( ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))? now)|(price in (usd|dollars|aud|cad))

My test data (90% real comments, some variations added by me):

Negatives:

As you all saw in the above here is the candle we stuck on top! This is available in the Questing Update Mod for a limited time Only 7 Days! so make sure to check it out while you still can! All Tier 1 Coal Modules put on the roof of the building will have this shiny candle! Happy Birthday Volcanoids!
behind me is free space
get the game on steam
guys I'm getting the game on steam today
Hey is there mods and if so where can I get them
how do get that
How do i get diamond drill parts, i need them to get to the volcano heart
how do i get shredder
how do u get arrested for that
I got so lucky to get the game from Steam before it got more expensive. But I can't play the game lol!
I wish I could play this game but I’m not able to buy it on steam
Interesting... Maybe that's what is going on...
is the update out yet?
is the update released yet?
Is this game only on steam
Just wondering, tried looking on google but couldn't find answers.  How do I do separate saves of co-op / single player games instead of it overwriting my old progress.
look at big games on steam
May i ask what is going on in Drillship #1?
question how do u get an engine part when u play the game without the tutorial
since my second screen which I keep my discord on is super low res, I had no fricking clue what is that green line on the pic
that what is this one :joy:
what is going on here
What is your opinion on this?
what is your volcano timer on when it just erupted?

Positives:

But once again I am asking if the game is free
can i play now
can i play this game now
can i play this now
can i play volcanoids now
Guys is the game free?
how do get the game
how do u download Linxi?
how do you get the game
How does one get the game on steam
How much does the game cost
How much does this game cost
how much does this game cost and will it possibly be made to go on playstation
How much does this game cost on steam?
how much is the game
How much is the game on steam?
how much is volcanoid
how much is volcanoids
How much money is that game?
How much money is the game?
How much money is volcanoids?
How mutch will it cost
Is it free
Is the game already on steam
Is the game available to download?
Is the game available?
Is the game on steam or discord
is the game out
is the game out
is the game out yet
Is the game out yet?
is the game released
Is the game up to download?
is this a game on steam?
Is this free
Is this game on steam?
Is this game released yet?
Is this on Xbox the game and can I play it now
is this out
Is this out yet
is this released
price in USD
Question is the game on steam?
So how can I play this game
Thanks also is it available now and is there in game purchases
This game available on steam right?
What’s this game called and is it on steam
What is the game gonna be on?
What is this game available on?
What is this game on
When’s it coming out?
when's it come out
when's it coming out
when's this coming out
where can i buy this
where can i buy this game
where do i buy it
Will the game be on steam dumb question but will it
Will volcanoids be free?

https://www.regextester.com/

PS: Regex notes 'cuz I'll probably forget.
( [^ \n]+?) Match any single word.
( (?!only)[^ \n]+?)? Match any single word excluding only.
(Don't forget the \n in [^ \n] else it actually matches past newlines.)

Repository owner deleted a comment from Hab3925 Oct 8, 2020
@Synthlight Synthlight changed the title Regex fileter for .steam auto-reply. Regex filter for .steam auto-reply. Jan 30, 2021
Repository owner deleted a comment from Hab3925 Jan 30, 2021
Hab3925 added a commit that referenced this issue Jan 30, 2021
@Hab3925 Hab3925 added the documentation Improvements or additions to documentation label Feb 2, 2021
Hab3925 pushed a commit that referenced this issue May 11, 2021
Merge Master into Master
Repository owner deleted a comment from Hab3925 Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants