I’m trying to do this thing that searches the number that is not followed by an “i”, for example: 21i and 16, it should only match 16 I tried /d+(?!i)/ but it also matches the 2 in 21i, how do i fix it? Answer So basically you need to find a cascade of numbers that not followed by an i
Tag: regex
Regex, match values inside of curly brackets
Having the next string { Hello, testing, hi stack overflow, how is it going } Match every word inside of curly brackets without the comma. I tried this: {(.*)} which take all, commas and brackets included. {w+} I thought this will work for words but it wont, why? Updated Tried this but I got null, why? Answer did you try:
Jquery/Javascript – Regex – Error only in Safari browser
Used below JS script with regex. To allow only numbers in input field. To change currency value with comma like 1,000 or 1,00,000 on user type value in input. Below codes working in all major browser expect in safari. Getting this error only in safari. Not sure how to fix this regex without affecting other working browsers. SyntaxError: Invalid regular
split textarea lines that starts with “-” regex jquery
i am trying to split each textarea line that starts with “-” or “- ” or ” -” into individual span element with specific ID 1,2,3,4 etc.. The closest regex code i found is ^-.+ but it wont work for me like it works on: https://regex101.com/r/yCOvyR/4 My current code is available also here: http://jsfiddle.net/ribosed/468emjct/59/ Thanks for any help. plit and
Strip everything after the last sentence [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I have this string: Using javascript regex, how can I strip everything that is after the last ., ?, !
How to add regular expression to filter out the xhr URL in Cypress
I have a scenario where in I have to process and validate the XHR response of nearly equal URLs: when I initialize the server in cypress and mention the xhr url as following, it always returns me the response of the URL-1 (which in my case is called first by the AUT) but I am unable to fetch the response
Regex – split string with delimiters into groups
It’s needed to parse strings like: object/custom/name1/name2 object/custom/name1/name2/typea object/custom/name1/name2/typea/item The result I’m expected to get is: group1: name1/name2 group2: typea group3: item Only group1 (the group with name) is required. Other groups (2,3) are optional. It depends on the string. E.g. for the first string should be present only first group with the string name1/name2. The string typea is static
Regex for matching all numbers and every first letter in words
I’m trying to define a regex which matches all numbers and only the first letter of each word in a string. The word can be preceded by an empty space or by a special character. Example strings and matches: I’m currently at this point: Which doesn’t quite work as needed. An explanation of the proposed solution would also be really
Cut and paste part of the string
I am using my own tags. They start with [ and end with ]. I would like to sort the tags. So instead of it should be This is what I have tried so far: So the tag [DYNAMIC] has been removed, which is good but it should be also placed at the beginning of the string. How can I
i want to count each word in a string but skip words that have special chars or numbers in them. ex (“j9[”, “h5”) will be skipped
Each word is a sequence of letters, (‘a- A-Z), that may contain one or more hyphens and may end in a punctuation mark period ), comma ().question mark (?), or exclamation point (1). Words will be …