Questions tagged as 'match'

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

Regex: Open and close with the same character and allow more than one type

You can get text between two characters that are equal, with the following conditions: The opening character should be the same as the closing character. Allow more than one character type at opening / closing. Simple example: /("...
asked by 16.04.2017 / 03:10
1
answer

How to set variable within the Match Method (String)

What I want is to include the variable within (/.../) and not its value. Code: var str = 'Seu texto aqui!'; if (str.match(/texto/)) { alert('Palavra encontrada.'); } Instead of manually defining, I want something dynamic...
asked by 25.03.2017 / 13:25
0
answers

Complete expression

Well, I have something like this: /^perfil[\/]?([0-9]{3})?[\/]?([a-z]{4,5})?[\/]?/i You need to create a function that, when receiving the information, transform it into perfil/431/abcd/ perfil/431/abcd perfil/431/ perfil/431 perfil/ perf...
asked by 08.12.2017 / 14:22
1
answer

Matching regular expressions with special REGEX symbols and line breaks

I need help in a regular expression that matches (% ) in a string whose: beginning is the end of a line with the character } continue marrying everything you find on the next line (including other escaped characters like \...
asked by 02.06.2017 / 18:47
1
answer

Sort query by relevance MYSQLi

How could you make the query below sorted by relevance and then by date? $query = $mysqli->prepare( "SELECT 'id', 'titulo', 'foto', 'descricao', 'slug', 'data', '' as 'local' FROM 'noticias' WHERE MATCH ('titulo', 'descricao') AGAINST (?) U...
asked by 12.09.2018 / 16:38
0
answers

Performance FULLTEXT SEARCH (MySql) between multiple tables

Hello! I have a problem that someone here may have solved. First of all, I want to try an WITHOUT USING ElasticSearch solution or something. Come on: I have a bank with approximately 40 tables that have the same columns. One of these column...
asked by 20.11.2018 / 13:01