Skip to content

Tag: regex

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 want to get the number even if there is a symbol in the middle.

Regex expression not returning entire term

The intention of the regex is to capture substrings wrapped between twin expressions in parentheses, kinda like html tags. For example: And here’s my code Can anyone tell me why this doesn’t capture the entire thing? Answer The characters () are special in a regexp and must be escaped with a if you want to match them literally. And

Need regex for project name with the following conditions

Need regex for the “Project name” with following condition. Expected Result: Take alphabetical, alpha numeric, alpha numeric symbolic Actual Result: that is, Everything is allowed but if it is just special characters and no text than it’s a problem. **Example: zjna5726$7&^#bsg //allowed %&*% // just special characters not allowed I tried /^[ A-Za-z0-9_@./#&+-]*$/ but did not help ^([w+d+]+)((-)([w+d+]+))* //did not

Split URL that contains more than one comma javascript

Basically I try to split a string of URL that contains more than one Comma, but the result turns out to be like this: Here is my code, is there a way to fix it…. URL Before splitted: Answer Since we know the url starts with https:// we can check each segment for it and build up url accordingly:

RegEx how I can find these 3 groups?

I have a string with three different texts inside the exact line, separated by a _ I want a regex to extract the first part of the data, a regex for the second, and one for the last part. The string is like xxxxxx_yyyyyyy_zzzzzz (where x, y, and z it’s random data). I have tried this: But I can only

Using regex to get all consonants until a vowel appears

I’m trying to create a higher order function that would do two things. First: it would check the first letter of a string if it’s a vowel, if it is, it would append at the end of the string ‘way’. I’ve done so with this code: Then I need to code to run a specific task while checking for consonants