Skip to content

Tag: regex

How to remove char from regex

I’m not got, yet, with regex. I’ve been trying to break my head to get this to work. I need a regex that allows the user to enter Any alphabetical char (a-z) Any number For special char only “-” and “_”. “@” is not allowed. I got this but no dice. [^a-zA-Z0-9] T…

Javascript Regex to match everything after 2nd hyphen

I’m trying to find a JavaScript regex pattern to match on everything after the 2nd instance of the hyphen – Here is an example: In this case, I’d like to only match the address so the desired variable to store would be: These characters 1 and H6205636 can change in length so I don’t th…

Regex to capture the group

I have a text where I want to capture email with line starting from “Email: ******” I have tried with .match(/Email:(.*)1/g) But I am getting [Email:] instead of 7c92e312-93d5-4354354-45435435@email.webhook.site How do I get the matching email from the group Answer You need to access the first cap…

Search for regex terms independent of symbol

So I have this string right here, it’s a registration number: 12.325.767/0001-90 And I want to create a regex when I type “23”, return for me the “2.3” or if I type “700”, return for me “7/00” or if I type “19”, return “1-9”. So, I …