All Questions
564 questions
0
votes
1
answer
74
views
JavaScript Split String with regex - match (how to replace match regex into split function)
let s = "AbcDefGH"
s.match(/[A-Z]+[a-z]*/g)
["Abc", "Def", "GH"] // This is what expecting with split function
s.split(/(?=[A-Z]+[a-z]*)/g)
["Abc", &...
0
votes
0
answers
73
views
Regex works in regex101, but not when I use it in js match
So, I'm trying to break a bunch of finnish names in to syllables to be used as data to make a name generator of sorts that makes, you guessed it, finnish inspired names out of syllables. However, for ...
2
votes
2
answers
94
views
Regex - How to capture Markdown H2 title and content in two named capture group
Hi i have a markdow text like the one below and i want to slice it in H2 tilte, H2 content
## **Intro**
* bla bla
* bla bla bla
## Tortilla
* chico
* chica
### 1. sub-section
* and another bla.
...
0
votes
2
answers
72
views
match all subitems in a string as different matches with regexp
I have a string and need to end up with an object that count all apples for every name, my struggle was to get separate match for each apple they took
In the part <@Viktor><@Kate>took:...
0
votes
3
answers
229
views
using match function to pick out phone numbers from stored data
I have the following code to match phone numbers and store them in variable "phone". however it also matches dates as phone numbers. for example, if I give it the following string:
html.Code ...
0
votes
2
answers
97
views
regex expression to find 10 or 100,1000...doesn't work
I create the regex /(10?|10{2,})/g to find 1,10 or 100,1000... but the code below doesn't return the expected result. I don't know where I went wrong, please help me!
<!DOCTYPE html>
<...
-1
votes
3
answers
76
views
How can I achieve this regex without a look ahead assertion?
I have regex which uses a look ahead assertion to match strings of the format {{ x }}. The regex is /(?<=\{\{\s)[^}\s]+(?=\s*\}\})/gm
How can I achieve this without using a look ahead assertion?
-3
votes
3
answers
119
views
JavaScript RegEx : Extract the first matched value from a Multiline Text
Well, I've a Multiline Text like below. I want to extract the first Matched Content value (Here, 10) after Messi: using JavaScript Regular Expressions. The Matching String (Messi: ) Can be on any ...
0
votes
3
answers
819
views
How can I split string using custom regex?
let myString = "Hello 'How are you' foo bar abc 'Strings are cool' d b s ;12gh gh76;"
const myRegEx = / \w+ "\w* +" | ;\w +; +/g // This what i have figured but its not working :(...
-4
votes
1
answer
58
views
Javascript Regex: get specific parts inside brackets without taking extra brackets
I am building a program that would simplify coding discord bots. I wanted to add inline functions, but seems like my regex selector is not the perfect match.
My program loops through every inline ...
0
votes
1
answer
71
views
How can you use Regex to search for a multivariable pattern and correctly implement a search method to find every iteration?
I need help searching through a text file that contains thousands of lines for a specific series of text. Regex are just above me at this point, though I've read through many web pages now on how to ...
0
votes
2
answers
78
views
Regular Expressions in Javascript - Find Multiple Lines of Text After a Tag
I have the text below stored in the variable description:
This is a code update
Official Name: None
Pub: https://content.upcodes.co/viewer/washington/wa-mechanical-code-2021
Agency:
Reference: ...
1
vote
3
answers
75
views
Regex get specific part of string after the nth "$" delimiter, js
So I have this for a discord command.
$command this my first text $ this is my second text $ this is my
third text $ this is my fourth text
I need to get for example the third text part, and it ...
0
votes
3
answers
73
views
regex to use negative look far behind along with positive look behind?
I need it to select only value which has :this in line but not include which are under comment section (/* */)
I have tried this one which works and give 3 results but it is incorrect as it select ...
0
votes
1
answer
100
views
NodeJS match with regex gets last word than after space
var prefix = '.'
var str = '.kick blah 1 2 3'.match(`${prefix}kick (.*) (.*)`);
console.log(str)
result:
[ 'blah 1 2', '3', index: 0, input: '.kick blah 1 2 3', ]
I wanted result to be
[ 'blah', '1 ...