HomePhabricator
Diffusion Comm 6f374ff961af

[lib] Set up RegEx to match text between two spoiler characters

Description

[lib] Set up RegEx to match text between two spoiler characters

Summary: Set up the RegEx to be able to match characters between spoiler characters (for now, the spoiler characters are > and <, so any text between >these two symbols< will be matched by the RegEx. This is for https://linear.app/comm/issue/ENG-1981/set-up-regex-to-match-text-between-two-spoiler-characters, and subsequent parts of the task will be stacked on top of this diff.

Test Plan:
Tested the RegEx on a random sentence with the two characters.
The result:

[NODEM] [
[NODEM]   '>spoilers here<',
[NODEM]   'spoilers here',
[NODEM]   index: 31,
[NODEM]   input: 'This is my testing phrase with >spoilers here<',
[NODEM]   groups: undefined
[NODEM] ]

Also a link to an interactive playground with the regex demo: https://regex101.com/r/EC2mJt/1

Reviewers: atul, ginsu, abosh, ashoat

Reviewed By: atul, ginsu, ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D5335

Details

Provenance
rohanAuthored on Oct 10 2022, 12:35 PM
Reviewer
atul
Differential Revision
D5335: [lib] Set up RegEx to match text between two spoiler characters
Parents
rCOMM143681278fe6: [keyserver] Update loader.mjs for new version of Node
Branches
Unknown
Tags
Unknown