All Questions
543
questions
-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 ...
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 ...
0
votes
4
answers
75
views
Regular Expression to validate a CAGE Code
We need to write a RegEx which can validate a CAGE Code
A CAGE Code is a five (5) position code. The format of the code is
the first and fifth position must be numeric.
The second, third and fourth ...
2
votes
4
answers
111
views
Regex to find match if a colon exists between double curly brackets {{key:value}}
I am trying to refactor the method below to use regex instead of indexOf:
hasMatch(value: any): boolean {
if (isDefined(value)) {
const valueStr = JSON.stringify(value);
return ...
0
votes
0
answers
15
views
I need to restrict only | Pipe special character from input in angular [duplicate]
<dx-text-box (onKeyDown)="Submit($event)"
(onValueChanged)="somthing()" maxLength="100"[(value)]="Description">
<dx-validator><dxi-validation-...
1
vote
1
answer
76
views
RegEx is not properly validated in production build, doesn't accept 0, 2, 7, a, c, u, x, sometimes also z
I'm using Angular 15.2.10 and Typescript in 4.9.5.
I have the following RegEx provided in one of my libraries and exposed via a service:
private readonly _DISALLOWED_CHARS_REGEX_GENERAL = new RegExp(...
-3
votes
1
answer
49
views
Regex for extracting monetary values
I have this regex /[0-9]*(\.[0-9]{3})*,([0-9]{2})?/g for extracting monetary values from text messages.
It is working nicely when the value is in this format:
R$ 1,00
However, if the text comes with:...
-2
votes
2
answers
117
views
How to write a regex for a decimal number scenario with a specific range?
I am trying to write a Regex that satisfies the below criteria.
I tried below one though few of my criteria doesnt match with the below regex.
^([0-9]{1,2})(\.0)|(\.[1-9]{1,2})$
A decimal number that ...
0
votes
0
answers
39
views
Getting invalid regular expression but functions correctly [duplicate]
I have an html input box where I use the angular directive [pattern]="emailPattern";
and have email pattern defined in my component file as:
public emailPattern = "^[a-zA-Z0-9._-]+@[a-...
1
vote
0
answers
61
views
regex not returning results of a search (problem with white space)
I am currently working on integrating a search feature using Angular. The feature will enable users to search for products based on their respective (brandName). As part of this integration, I am ...
-1
votes
1
answer
105
views
Regex works, but not in Angular Form [duplicate]
I need to use this regex for url validation. It works in regex101.com, but it fails validation in my Angular field. I don't know how to modify it in a way that Angular accepts.
regex: https:\/\/[A-Za-...
0
votes
1
answer
74
views
value replacement not allowed not working Angular - regex
I have a regular expression that allows only letters inside a text field, it works fine when writing something in the field, but when the user pastes a string with characters not allowed I have to do ...
0
votes
0
answers
16
views
Angular 15 - Pattern attribute value is not a valid regular expression [duplicate]
Recently, I updated my application from Angular 9 to Angular 15. After fixing most of the issues, the console throws the following error for my input pattern that has been working before the update:
...
1
vote
1
answer
372
views
Pattern matching issue in Angular 14 regex validator
I am having an issue with pattern matching validation in angular 14. I have a dynamic text component that can support multiple different types of text input and custom pattern validation can be ...
0
votes
0
answers
1k
views
NGX-Mask special characters
I have a functionality where I defined custom pattern and it should allow user to enter any alphabets, numbers, spaces and special characters. In this example lets say $
At the same time I have '$' as ...