All Questions
568
questions
0
votes
0
answers
51
views
extract string emojis from text [duplicate]
i want to extract string emojis from string to array of string.
Previously, i had this regex:
const regex = /([\u{1F600}-\u{1F64F}])/gu
and i was using it like this:
const parts = text.split(regex)....
1
vote
1
answer
37
views
Regular expression for user name
I want to write the regex for a user name. It should contain at least 8 characters, starting with an alphabet character and containing at least one uppercase, one lowercase and one digit, with a ...
0
votes
1
answer
40
views
Regex pattern matching every url and not filtering
So I have the following urls from an app:
1.${endpoint}/list?currentPage=1&itemsPerPage=20&orderBy=name&orderType=1
2.${endpoint}/list?current=true¤tPage=1&itemsPerPage=20&...
0
votes
1
answer
87
views
ReactJS - Replacing first occurrence of string pattern with custom component
I have a number of strings with this format:
'The model of that car is [assignment: any car model] and it has [assignment: any number] horsepower'
I want to display this string in my UI and replace ...
1
vote
0
answers
81
views
Formating an input field to accept 0, 0.1 and negative numbers
I want the input below to accept $0, $0.01, and negative values but no luck. Any ideas ? It will be nice to keep the commas if it a million.
<div className="form-group has-validation ...
0
votes
0
answers
59
views
RegEx assistance for CMS custom widget
Lemme just get this out in the open, my RegEx knowledge is dire, when I need it, I tend to find solutions through Google, test them in a helper and hope for the best.
So, I have a site that uses a ...
0
votes
1
answer
491
views
custom syntax using react-markdown
I need to add my own syntax to react-markdown, for example so that the text inside {{ }} changes color to blue and at the same time works correctly using another syntax, for example ## Header {{ }}
...
0
votes
0
answers
21
views
Regular Expressions Bug with Javascript/React [duplicate]
I have 3 regular expressions here. USERNAME_REGEX & EMAIL_REGEX work independently without any errors. However when I use IDENTITY_REGEX it gives me an invalid character class error:
REGEX
export ...
0
votes
0
answers
69
views
Regex for car number
Good afternoon, I need a mask so that the user can enter at the beginning: 1 - letter, 3 - digits in a row, 2 letters, a space, 2 or 3 digits. Type A111AA 777 or C111TY 45 format. I get false all the ...
0
votes
0
answers
120
views
Javascript predictive text from form input - showing a list of options and overriding the hint when an option has been chosen
I am working on a predictive text feature that analyses the text from an input - and if the user is about to trigger a predictive wild card to populate the hint text and override if need be with the ...
-2
votes
1
answer
59
views
Variable outside of function, tried RegEx but can't seem to make it work
I have a function which should remove the number at the end of a class and replace it with a random one. But I have to declare a variable before the function to make it work. It is just a random ...
2
votes
1
answer
183
views
Javascript - regex doesn't work on MAC OS - encoding?
I have the following situation:
On my React app I have this regex to validate file names:
const validCharsRegex = /^([\w\s()+[żźćńółęąśŻŹĆĄŚĘŁÓŃ-]+)(\.[A-Za-z0-9]+)?$/;
if (!validCharsRegex.test(file....
0
votes
1
answer
141
views
Regex to insert hypnonen antd input
In my application, I have an antd input. I need to put here some type of mask like 123-456-789-123. So I'm trying to use Regex. But nothing works for me.
Here is live example
https://codesandbox.io/s/...
0
votes
1
answer
77
views
How to let the input in react accepts only float number between 0 and 1?
I have a text input that I want it to accept only float numbers between 0 and 1.
const Page = () => {
//previous states ...
const [currentElectricityPrice, setCurrentElectricityPrice] = useState(...
0
votes
0
answers
17
views
I have error at console: Pattern attribute value ...is not a valid regular expression [duplicate]
using React, I am supposed to build a form, I was given a pattern I have add to input :"+?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-. \s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}" ( phone number validation)
...