Questions tagged as 'regex'

1
answer

How to look for the same occurrence of a term independent of its position in a string?

I need to create a regular expression that finds the value src=path-da-imagem in whatever position it is. Example: With the expression <img\s(src=\S*)\s(.*?)\/> I can find the result in: <img src="../../../assets/i...
asked by 11.04.2018 / 00:08
1
answer

How to search using regular expression in delphi 7 [duplicate]

In delphi 7 when opening the search dialog box: CTRL + F and selecting the option: Regular Expressions would like to find anything starting with the word GPField and ending with IsNull For example, I have the following code: if GPFiel...
asked by 06.06.2018 / 14:51
1
answer

How to select text that does not have a certain term in the middle?

I'm trying to select a part of an HTML code with RegEx but I'm not getting the regular expression correct, could anyone help? I need to select the <li> groups separately, ie without the presence of the <br> tag in th...
asked by 31.05.2018 / 22:34
1
answer

Policy to restrict typing with regular expression in AngularJS

I wrote a directive to inhibit typing from specifying a regex. However there are two bugs in this solution: In the first example input should allow only numbers or numbers followed by periods [.] , or followed by periods followed by nu...
asked by 15.01.2018 / 15:18
2
answers

Separate content from a room via Regex

In 2 variables I want to perform the following operations. In the 1st, var chat1 , separate via regex 4 information: " A: ", " How are you? ", " B: " and " I'm fine, thanks. ", and be able to access them through their indexes using the cap...
asked by 17.01.2018 / 02:00
2
answers

Regex to match in citation title

I'm trying to capture all the titles of citations in scientific articles, my regex looks like this:    (A-Za-za-a-a-ee-i-a-i-oo-a.) (0,1) (0.1) (0.1) (0.1) (0.1) (0.1) (0.1) -Za-z0-9: -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
asked by 03.04.2018 / 17:18
1
answer

Regular expressions do not match the desired text snippet

I'm needing my program to capture an item from a certain text, but it's not doing it, instead it's capturing everything that comes after that. Code that I'm using, eg: String html = "ItemPago12.569,00DeducoesPagas36.567,52ItensQnt6DeducoesR...
asked by 31.03.2018 / 23:22
2
answers

When I put the \\ b in the pattern.compiler it returns the find as false

When I put \ b in pattern.compiler it returns matcher.find as false, because it can not find a pattern just because of \ b. Following the code I use: final Pattern py = Pattern.compile("\b(print|True|False|int|str|float|bool)\...
asked by 06.10.2017 / 14:25
2
answers

A regular expression to detect acronyms of Brazilian highways

I'm trying to detect if a particular address corresponds to a Brazilian highway. For example, br-101 matches. My initial plan was to list the state acronyms (mg, sp, rn ...) plus the abbreviation br, and write something like /sig...
asked by 07.08.2017 / 23:57
2
answers

How to cut a suffix of an expression in bash (egrep / sed / etc)

I am making a script that works with directories that have suffixes defined and separated by ".", for example "folder.teste.git" or "things.var" and would like to take as a variable only the prefix eliminating the last one part (eg the name "fol...
asked by 04.08.2017 / 00:37