Questions tagged as 'regex'

6
answers

Regular Expressions with Java Patterns

I need to do a college exercise that is as follows: Validate with regular expressions any word that contains exactly two 'a' characters and two 'b' characters or more. I made the following expression in class Pattern : Pattern pattern =...
asked by 23.02.2017 / 03:01
2
answers

Extract groups with regex

I need to extract the session and date from the line below, the date I have separated with a dash and a bar. The patterns work correctly individually but when I try to extract the two, nothing comes. Pattern p = Pattern.compile("(\w{8}-\w{4...
asked by 20.03.2017 / 15:15
2
answers

Regex for subdomains or different domain of the system

I am developing a system where each user will have his subdomain according to his login but also will allow him to configure his own domain. As I'm developing locally, I've also added a few rules to make everything work on my local machine....
asked by 08.09.2016 / 15:57
1
answer

Preg_match_all, get the values of the attributes name of the inputs

I'm doing a project with dynamic forms, that is, the user (administrator) can make their own form (HTML / CSS), but when I go to get the form to the database I need to check if the names ( name ) of inputs match the names of the com...
asked by 22.09.2016 / 19:15
1
answer

Regular expression strsplit

How do you assign E.R to separate the name of the city? cid <- c(cidade1..SP.Brasil,cidade2...SP.Brasil,cidade3..SPDF.Brasil,cidade4...SPDF.Brasil) In the sublime, for example, this works: \.{3}[A-Z]{4}|\.{3}[A-Z]{2}|\.{2}[A-Z]{4}|\.{2...
asked by 13.01.2017 / 13:42
1
answer

Regular expression to identify text box in HTML form

Situation Give yourself a HTML page where you will find a form containing two text boxes, one for the name and one for the email. Then there was the need, to do some tests on Android, to get only a snippet of the code and play in a list, but...
asked by 28.08.2016 / 21:34
2
answers

Insert string in first column

I'm breaking my head with something very simple, I need to insert a ";" (semicolon) after a sort / uniq in a file. As the number of repeated rows returns, I need this return that is always in the first column to be inserted this ";". I already s...
asked by 03.03.2017 / 20:32
1
answer

How to do regular expression to accept words and then 2 numbers with jQuery, without special characters?

Hello everyone. Next, I am doing a regular expression to accept the following: Word 02. Word and numbers, not just numbers. I'm using this code: $(".inputNomeTurma").keyup(function() { var valor = $(this).val().replace(/(([a-zA-Z]*\d{3,})|...
asked by 26.01.2016 / 15:43
1
answer

Questions about using Contains with Regex in C #

I would like to use the Contains method in a code in C #, but instead of passing a string literal, that is, a specific word, pass a pattern or a regular expression as a parameter. For example: Instead of passing: bool nomeDaVaria...
asked by 22.01.2016 / 23:35
1
answer

Regular PHP expression, how to remove open html tags?

Hello! I need to remove from my string an html snippet that bugged, it goes like this: e="text-align:left;"> Texto normal ... This causes a visual error. Another error that is generating at the end of the text ex: <p style="text-ali...
asked by 16.05.2016 / 15:44