All Questions
6,759
questions
0
votes
0
answers
35
views
Creating Many Radio Options with Different Image Sources and Values - Visual Studio
So I'm working on a project where one radio name has 96 options and looking for a way to streamline adding all of them rather than manually changing the input's id/value and img's src/alt. I know that ...
2
votes
1
answer
87
views
Issue Using Regex Pattern in HTML Pattern Attribute
Issue Using Regex Pattern in HTML Pattern Attribute
I'm encountering an issue where a regex pattern that works correctly with the .test() method in JavaScript is not functioning as expected when used ...
0
votes
0
answers
23
views
Regex. HTML pattern. Invalid character in character class [duplicate]
I have a simple regular expression to match initials. Regex101 seems perfectly valid, but the HTML input pattern detects a syntax error:
^\p{L}+(?:[-'\s]\p{L}+){1,2}$
regex101 example
Also, the ...
0
votes
0
answers
18
views
How can I use preg_match_all to get text not wrapped in html and store in array [duplicate]
I'm working with inconsistent field values like below that I would like to organize into an array.
Field value example:
<ul>
<li>List item 1</li>
<li>List item 2</li>
<...
0
votes
1
answer
116
views
How to use HTML5 input pattern attribute to validate Latin and extended Latin characters only
I am working on a web form where users are required to input text that should only contain Latin characters, including extended Latin characters (such as ñ, é, ü, etc.), but should exclude any non-...
1
vote
1
answer
68
views
Allows only numbers from -5 to 75 AND one decimal that is a 5
I would like some help with a regEx pattern that only allows the numbers -5 to 75 and one decimal that ends in 5 for an input type="text". e.g:
-5
-4.5
12
0.5
66.5
75
I have this regExp ^-...
0
votes
0
answers
23
views
How to convert valid regexp to html pattern? Invalid character in character class [duplicate]
I would like to convert valid regexp to html pattern.
Most likely due to new v flag following regexp is no longer valid: ^[a-zA-Z0-9а-яА-ЯёЁ]+([ -][a-zA-Z0-9а-яА-ЯёЁ]+)*$ pattern and gives an error:
...
0
votes
2
answers
149
views
Extract all <a> and <img> tags (exactly as represented in the input) from HTML 5 that contain a specific class
I need to improve some open source code. It contains a function to extract all <a> and <img> tags with a specific class from a string that represents HTML. This function uses regular ...
1
vote
1
answer
102
views
How to scrape Star Rating from Etsy HTML with Python?
I can not find a way to extract the star rating from each product from the Etsy source code.
This is the code I've used to extract the description, price, number of reviews from a set of text files ...
1
vote
4
answers
130
views
Regular expression to find words that begin and end with
Good evening, (sorry for my English is not my native language) I'd like to find words in HTML text.
I don't get what I want and I ask for help. Sample text:
<div class="text-slate-500 text-...
-2
votes
2
answers
75
views
What Python script will find the locations of every backslash inside of an HTML tag and replace the backslash with a forward slash?
Input:
<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
<\head>
<body>
<div>
<p>H/e/l/l/o \a\b\c\d\e\f\gw/o/r/l/...
0
votes
1
answer
123
views
Adding <mark> tags based on user search by JavaScript
I am working on a functionality that highlights text in a list of items using the <mark> tag based on user input. I cannot simplify the HTML code of the <li> tags. I have a version that ...
-2
votes
1
answer
109
views
HTML5 email input pattern validation to not allow personal email addresses
What's a regular expression that could be used for input pattern validation so that email addresses that include @gmail.com, @hey.com, or @fastmail.com are not treated as valid?
<input
type="...
10
votes
1
answer
502
views
Why does a regex using an unescaped dash `-` character not seem to work in a `pattern` attribute in HTML but it works when testing on regex101?
<div class="formRow">
<label for="phone">Phone number</label>
<input name="custPhone" id="phone" type="tel" placeholder=&...
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-...