Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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 ...
PsychedelicSeal's user avatar
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 ...
Guy Ben David's user avatar
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 ...
Predaytor's user avatar
  • 114
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> <...
Josh Kern's user avatar
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-...
tony's user avatar
  • 580
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 ^-...
thegreenedition's user avatar
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: ...
ZiiMakc's user avatar
  • 35.1k
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 ...
Pida's user avatar
  • 978
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 ...
Santiago V's user avatar
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-...
Alb0174's user avatar
  • 13
-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/...
Toothpick Anemone's user avatar
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 ...
Daniel Schreurs's user avatar
-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="...
GeekJock's user avatar
  • 11.2k
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=&...
Mark's user avatar
  • 127
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-...
user3131148's user avatar

15 30 50 per page
1
2 3 4 5
451