filmov
tv
regex - How can I extract a number from a string in JavaScript?

Показать описание
I have a string in JavaScript (e.g., #box2), and I just want the 2 from it.
I tried:
var thestring = $(this).attr('href');
alert(thenum);
It still returns #box2 in the alert. How can I get it to work?
It needs to accommodate for any length number attached on the end.
I tried:
var thestring = $(this).attr('href');
alert(thenum);
It still returns #box2 in the alert. How can I get it to work?
It needs to accommodate for any length number attached on the end.
[5 Minute Tutorial] Regular Expressions (Regex) in Python
Learn Regular Expressions (Regex) - Crash Course for Beginners
REGEX (REGULAR EXPRESSIONS) WITH EXAMPLES IN DETAIL | Regex Tutorial
Introducing REGEX Excel Functions - Extract, Clean, and Format Data Easily! (NEW!)
I’m never writing another regex. EVER.
Regex HACK #vscode #code #programming
How to Match Special Characters (Email Example) - RegEx Beginner Tutorial
Regex made simple: a powerful tool to find patterns
Easy Data Cleaning with NEW Regex Functions in Excel
How to use regex to check if a javascript string contains a pattern #shorts
Regexper - Great tool to visualize your regular expressions #shorts
RegEx Tutorial: Learn Regular Expressions - Full beginners course 2022
What is Regex?
Intro to Regular Expressions - How to use Regex in C#
Regular Expressions in JavaScript - #1 REGEX ULTRA BASICS
Learn RegEX Faster with AI
How Regex in C# can kill your app
Regular Expression Examples Part 1 | Regex | Explained | Walk Through
Learn Regex For Make.com In 34 Minutes
Regex C# Tutorial: FINALLY Understand & Read Any Regular Expression!
Regular Expressions in C# with Practical Demonstration | C# Tutorial for Beginners | Regex in CSharp
Positive & Negative Lookaheads - RegEx Beginner Tutorial
Hate Writing RegEx? DO THIS #programming #chatgpt #productivity
Regex (Regular Expressions) | Search Pattern #shorts #coding #programming #technology
Комментарии