Questions tagged as 'regex'

2
answers

Match in string does not work with 1 character

I have the following obstacle: var myString = "c/q/1"; var match = myString.match(/c\/q\/([a-zA-Z0-9-].+)/); But match returns as null , already in the following example: var myString = "c/q/stringdegrandevalor"; var match =...
asked by 10.06.2018 / 02:34
2
answers

preg_match (...) for various types of text

How can I validate the texts below? Letters (including accents) and numbers (without spacing), separated by. or,. ex: 'hello' Whole numbers and / or tenths. ex: '22' or '2.2'     
asked by 29.08.2016 / 11:48
4
answers

Regular Expression to get what is outside the square brackets

Sample text: Itaú [123.456,89] To get what's inside the brackets (including the brackets) I used: \[(.*?)\] The question is how to get what's out? I suppose it's a denied list, something simple. I already searched more than hours an...
asked by 21.08.2015 / 17:34
1
answer

How to insert blank spaces - Javascript

I'm doing some exercises and one of them asks me to create a code that reproduces an "ASCII art", I read about it and saw it was a special character and tried to insert space in its unicode form "\ s", "\ u0020 ",but without success. I saw some...
asked by 06.08.2018 / 16:55
1
answer

Regular expression to extract numbers from "200 # 5; 300 # 10"

What would be the best regular expression for the following entry "200 # 5; 300 # 10"?     
asked by 19.10.2014 / 12:42
1
answer

Is it possible to remove the first sequence of the last letter of the regex?

I need help with something very specific, which involves good interpretation, which is the following, I need to give a word in%% example% with% the last letter that would be regex to be extended until the first sequence of nt and s...
asked by 30.01.2018 / 19:21
1
answer

The end of a catch in a regular expression

I do not know which title could get better than this, as I do not quite understand technical terms related to the regular expression. But I will describe my problem. I have a code, where I generate a regular expression to be able to capture a...
asked by 29.01.2016 / 13:11
2
answers

Regex string javascript

I need a regular expression that removes all special characters, and spaces of a string if it is a letter with an accent remove only the accent. Would anyone help me?     
asked by 22.02.2016 / 02:34
4
answers

How do I replace with the '\' character with RegExp?

I need the character '\' (Reverse Solidus) to be included with the value of the captured group. Example: In the sentence assets / pdf / regulation_demais_ddds_ Hi Mod.pdf , I need the excerpt    / pdf be replaced by \/pdf\/ f...
asked by 13.04.2018 / 17:37
2
answers

Problem, regex capturing everything

I'm having trouble with a Regex query, it's not only catching 1 de 8 as I wish, it's taking a lot more of it, see: link This is the string I'm trying to match: <span class='pages'>1 de 8</span><span class='current'&g...
asked by 17.01.2015 / 19:16