All Questions
Tagged with javascript regex
37,444
questions
0
votes
1
answer
47
views
Regex not matching group at the end of the string, even though $ is included
The string format is similar to:
1) some question text
A)option
B) option
C) option
D) option
2) some question text.
A) option
B) option
C) option
D) option
etc.....
0
votes
0
answers
23
views
Select2 ajax based results filtering based on regex on client and server side
I have implemented select2 in codeigniter for ajax based results and its working perfectly. But the challenge I am encountering is that the data in database is not sanitized e.g
E.C.G Machine
ECG ...
0
votes
1
answer
26
views
"if regex.test" doesn't works properly on javascript vuejs router [duplicate]
const router = createRouter({
history: createWebHistory(),
routes,
});
// ...
const allowedToAnonymous = [
/^\/login$/g,
/^\/signup$/g,
/^\/home$/g,
/^\/emailconfirm\/[0-9a-zA-Z]{8}$/g,
...
0
votes
1
answer
26
views
Issue retrieving City/State/Zip line from block of text
I have a bunch of blocks of text that will contain address information such as:
Fake Name
Business name
60 N Address Ave.
San Jose, CA 95126
(555)255-5555
Email: [email protected]
I need to ...
-4
votes
0
answers
33
views
JavaScript Validation regex to allow only alphabet text or alphanumeric only [duplicate]
I need Javascript validation regex to allow only alphabet text or alphanumeric only.
Example -
dGgs1s23 - valid
12fUgdf - valid
abchfe - valid
ABFGC - valid
121232 - invalid
abd()* - invalid ...
0
votes
1
answer
54
views
vuejs @input is getting called only after onfocusout, i want to call it when user is typing
i am trying to use @input on input field in vuejs, but the function assigned to it gets called only after user has stopped typing and the focus is out of the input field, that means it is getting ...
-1
votes
0
answers
49
views
Regex for file Names that begin with T- [duplicate]
I want to all files that start with T- and contain only numbers to return a match:
T-123-32.DOCX
But if the file contains letters it does not return a match:
T-12G-XX-X.DOCX
How can I have it ignore ...
0
votes
1
answer
41
views
Extract all matching font-family attributes from string [duplicate]
I'm trying to extract values of all attributes in an HTML snippet that match font-family:"" pattern
Example input:
`<body lang=EN-ZA style='tab-interval:36.0pt;word-wrap:break-word'>
&...
0
votes
0
answers
49
views
Javascript regex is working on desktop but not working on mobile
I am using regex in vuejs to manipulate input field data.
below is the code:
<input
v-model="inputValue"
type="text"
:placeholder="placeholder"
:class=&...
-1
votes
0
answers
13
views
How to extract the class name only by using default toString method and regular expression together? [duplicate]
I used the following :
let s = { x: 1, y: 1 }.toString(); // s == "[object Object]"
console.log(/\b(\w)+]$/.exec(s)[0]);
It gives the output : Object]
How to get rid of closing squre ...
0
votes
0
answers
28
views
How can I avoid returning a non-optional group that is undefined? [duplicate]
I've two possible strings:
TEXT1, TEXT2\n\nTEXT3
TEXT1, TEXT2
Each text should be extracted without the comma and new line characters. I'm able to extract the first one with:
const regex = /^\s*(.*),...
2
votes
2
answers
84
views
Append new line if '\n' appeared in API response
I am working on some front end task , where I am showing some APIs response on UI
The thing is in my API response I am getting some messages which includes '\n'.
So wherever '\n' is coming I want to ...
2
votes
4
answers
80
views
Grouping text with regex
consider I have a text like :
Some text 1
`special text`
Some text 2
I can get "special text" with regex, but I want other parts of the text too as an array, something like this :
[
Some ...
1
vote
0
answers
39
views
How can searches too-large-for-regex be performed in DataTables in an R Shiny app?
I need to search a specific column in a DataTable for such a large number of terms that the table.search() using regex doesn't work. All of my search terms will either match exactly or not at all. Is ...
1
vote
1
answer
50
views
Regex for nested tag detection
I have a document generation application that handles tag replacement, I use a regular expression to detect said tags. These tags can be of multiple types, for the sake of the problem let's take into ...