Posts by Paz • 3,062 points
112 posts
-
0
votes1
answer286
viewsQ: Run a precedent while the component is pressed
I have a multi-device application made in Delphi-XE8, in it I have an image (TImage) of rocket and other 2 of arrows, would like the rocket moves on the x axis of the screen (Position.X), but with…
-
0
votes1
answer75
viewsA: Several filters in a regex
Use that regex: ([a-zA-Z]+-\d+_{0,1}[a-zA-Z0-9]*) Explanation: [a-zA-Z]+ Validates if there is one or more of a letter. - Validates if there is a character - after the letter. \d+ Validates if there…
-
5
votes4
answers24927
viewsA: Regex - Picking text up to a given string
Use that regex: ((.|\n)*?)(a\).*?)\n*?(b\).*?)\n*?(c\).*?)\n*?(d\).*?)\n*?(e\).*?)$|\n*? It will separate the text into groups where: Group 1 - Contains text before option a). Group 2 - Captures…
-
0
votes1
answer260
viewsA: Split text
Try this code: var pattern = /<tag.*?>(.*?)<\/tag.*?>/g; //Padrão que a regex vai dar Match var reader = new FileReader(); //Leitor do arquivo txt var output = ""; //Variável de texto…
-
1
votes1
answer530
viewsA: Capture digit between parentheses
I want to capture the text and digit (if any) that is in parentheses Try this regex: (".*?)\((\d*?)\) [...] to transform it into the form "08.070.838/0001-63.offset+1". To make this transformation…
-
5
votes1
answer222
viewsA: Why is there no Lookbehind in Javascript?
Updating Lookbehind was accepted in specification of Ecmascript in 2018. So far it has been implemented only in V8. So if you’re a developer of Chrome-only environments (like Electron), or Node, you…
-
2
votes2
answers593
viewsA: AND operator in regex
It has 2 groups, but the two groups return only part of the date: 25/01/2017. In fact your groups return different things: (?<data>\d{1,2}/\d{1,2}/\d{4}) - Returns: 25/01/2017…
-
0
votes1
answer453
viewsQ: Return number of rows or columns of an array
I have a matrix like this in Delphi XE8: Matriz[2][3]. I wonder which method can I use to return the number of rows or columns in this matrix, my idea is to loop with 2 for's and traverse the matrix…
-
1
votes2
answers72
viewsA: When I put b on Pattern.Compiler it returns find as false
I believe you’re using the matcher.find incorrectly, the value returned by this method changes at each position of the parsed string. Your pattern is giving match and finding the word print, but it…
-
7
votes4
answers2886
viewsA: Convert HTML to PNG
I would use the library: gift-to-image You can read the documentation about its use here Here comes an example: var node = document.getElementById('my-node'); domtoimage.toPng(node) .then (function…
-
1
votes2
answers85
viewsA: Quantify new line ( n) in regex
Is there any way to quantify many paragraphs other than literally to use with PHP? Yes, you can use the token .* together with \n to capture an entire paragraph. Then put them in a capture group and…
-
2
votes3
answers4764
viewsA: Expression within ng-disabled
As mentioned by the user Jackson: When a checkbox is checked, it automatically becomes TRUE The way you did it will only work if one of the two checkboxes is unchecked, because you used the negation…
-
1
votes1
answer571
viewsA: VBA Regular Expressions - Extract substring
[...]would like a Pattern of regular Expression, compatible with VBA, to extract localized text between the equals sign "=" and the first line break [...] There are 2 ways to capture this: You can…
-
2
votes1
answer41
viewsA: Increment content found by regex and increment with other strings
Answer Use this regex p/ capture: (\d{2}h\d{0,2}) In the replacement part use: <br>\1 You can see how this regex works here. Explanation \d - identifies a number (0-9), equivalent to [0-9] {2}…
-
1
votes1
answer32
viewsA: Check occurrence in REGEX for php files
You can use this regex (.*?;){10}(.*?); Explanation (.*?;) - This sequence captures everything before the character ; so Lazy. {10} - This is a quantifier, here it expresses that the previous…
-
0
votes2
answers98
viewsA: How to remove the Comma from the last occurrence [PERL]
Use that regex. (.*?)(,)(}) It will capture everything to the last comma that will be followed by the lock of keys }. After this just replace with capture groups 1 and 3. To use the content captured…
-
2
votes1
answer150
viewsQ: Using data from an array in a Report
I have a matrix like this that is being filled in Runtime: MatSort[0][0] - Nome1 MatSort[0][1] - InfoNome1 MatSort[1][0] - Nome2 MatSort[1][1] - InfoNome2 But I don’t know how to reference the data…
-
0
votes5
answers4863
viewsA: How to make a regex that ignores non-alphanumeric characters?
It is not possible to do what you want using regex. In a regular expression you must designate what you want to find through a logical sequence of tokens and quantifiers. In your case you want to…
-
3
votes3
answers709
viewsA: How to capture repetitions of a given group with regex?
How to capture repetitions of a given group with regex? There are 2 alternatives: Use the resource match Previously named capture group (find the previously named group), with it you can designate a…
-
3
votes1
answer43
viewsA: Visual Studio has shortcut to navigate to a similar file in Sublime Text, when we press CTRL+P?
The command you’re looking for is the "CTRL + ," it opens an input box like this and you type the name of the file, so you are typing it will update with the options. This command works both in the…
visual-studioanswered Paz 3,062 -
0
votes1
answer65
viewsA: Problem with regex for Android Useragent
Try using this Regex (?P<browser>Android)\s(?P<major_version>\d+)\.(?P<minor_version>\d+\.?\d?);(?P<lang>\spt-br){0,1};{0,1}(?P<device>[ \w\-?]+)\s You can test how it…
-
1
votes1
answer1235
viewsA: Validate URL Regular expression
Considerations: I see no need for such an extensive regex, in which case I would define a URL with something that starts with the http prefix or https or ftp, followed by "://www." address and end…
-
1
votes1
answer107
viewsA: Order of evaluation of the alternatives in a regular expression is always taken into account?
Is there any RFC documentation to confirm that expressions run your options in order in all situations, uses and programming languages? Yes, you can find documentation about your problem here: See…
-
2
votes2
answers6439
viewsA: How to make a regular expression that finds a name and then looks for a character?
Answer As mentioned by the Wellington user, you should follow the steps: Go to Search-> Replace. Set the value of the Search/Find field: (<.*?(?=mensagem).*?>)(.*?)(<.*?>)|(.*) Set…
-
0
votes1
answer62
viewsA: Replacement with sed
Answer Use this regex to capture what you want: NF.*?(\d*)\|.* And that part in the substitution Re1_91910_$1 Resulting in: Re1_91910_1456 You can test the operation of this regex here. Explanation:…
-
0
votes1
answer495
viewsA: Fast Reports tools do not appear in the Palette tool
Fast Reports 5.0 works only for projects of the type VCL, do not work in Firemonkey multi platform, as was the case in this project specifically, so it is no use installing the component, as the…
-
4
votes1
answer101
viewsA: Regex custom python time 3
Because your regex doesn’t work You made a lot of mistakes in it, it happens to those who are starting, I will not only show you where you made a mistake but I will explain a better way that I hope…
-
0
votes1
answer495
viewsQ: Fast Reports tools do not appear in the Palette tool
I am using Delphi-XE8 in a project that requires the creation of forms from DB data (Firedac), before my team used the version of Delphi-XE4, which made use of the external component Rave Reports of…
-
1
votes1
answer333
viewsA: Rave Reports Delphi Seattle
The rave Reports is a component created for Delphi by Nevrona, which allows you to create forms in Runtime. Before fast Ports (Embarcadeiro’s own component) it was necessary to use rave Reports to…
-
0
votes1
answer47
viewsA: Virtualhost configuration
To capture the patterns you want, you can use this regex: (meusite\.com\.br\/app)(\/{0,1})(?!.{1}) And use a replacement group like this: $1\/escolherestado You can check the operation of this regex…
-
1
votes1
answer436
viewsA: Capture groups where a specific word appears with Regex
Answer If what you want is to identify the words that are preceded by "dog " can be used a Positive lookbehind. ((?<=cachorro )corre\w+|(?<=cachorro )foi|(?<=cachorro )pul\w+) You can see…
-
0
votes1
answer495
viewsA: Regular expression to validate urls
There are some means of doing that which you mentioned in the question, you can only capture the links that do not have the characters you mentioned (!#) or ignore the link if the character you want…
-
2
votes4
answers147
viewsA: I cannot use Boundary( b) to validate a word starting with "@"
As quoted by the elders rray and Sergio, a word Boundary is set to start in characters [a-z A-Z 1-9], but this can be reversed with a regex like this: (@\buserid\b) Explanation: This regex…
-
4
votes2
answers246
viewsA: AWK regular expression print inside brackets
Try using this with the input you receive: 'awk 'match($0, /prefix-count=(.*)/) { print substr($0, RSTART, RLENGTH) Explanation: 'awk 'match($0, - Starts awk and starts the Regex part with the space…
-
2
votes3
answers6518
viewsA: How to access the code behind a Stored Procedure?
Command can be used: sp_heltptext 'nomeCompletoDaProcedure' That makes the Procedure return as records in the preview part of table on DB. If you do not want the return as records can be used Ctrl+T…
-
3
votes3
answers6518
viewsQ: How to access the code behind a Stored Procedure?
How can I access the code behind a stored procedure? I’m using Microsoft SQL Server Management Studio.
-
1
votes0
answers258
viewsQ: What is an interface?
Background (TL;DR): I’m working on an ASP.NET project legacy, I was testing some features of it when I got an error in the browser console: Failed to load resource: the server responded with a…
-
2
votes2
answers766
viewsA: How to create a regular expression to validate only cell phone number?
Regarding the question, I think you should be a little more specific, its title does not match the description of the question. Responding to the title: You can create a regex that reads the digits…
-
3
votes1
answer23
viewsQ: Advantages of Watch compared to Break point
Since it is possible to evaluate the value of a variable by inserting a break point where it will be used, I see no apparent advantage. Is there any advantage to using watch instead of break point…
-
3
votes1
answer1318
viewsQ: What is $Parent in Angularjs?
I’m reviewing a colleague’s PR and came across the use of $parent, I read a little in the documentation of angular, but I can’t understand what it does. It is used within a dialog created within…
-
0
votes1
answer193
viewsQ: Methodology for planning a mobile app
Background: I was thinking of starting a mobile app project alone, but not to be something tiresome and with no prospect of ending, I thought of organizing the activities in the method Kanban, after…
-
2
votes1
answer349
viewsA: Regular Expression that makes SQL Injection impossible
As SQL injections in general possess =or ;, they are basically constituted in 2 groups, "Always true" or "Batched SQL Statements". I suggest you use a regex which captures one of the above…
-
8
votes5
answers1745
viewsQ: Console utilities.log()
I was doing a refactoring on a code made in the format MVC, making the code more readable, eliminating duplicated code and deleting variables and API’s that were no longer being used. When deleting…
javascriptasked Paz 3,062 -
6
votes2
answers348
viewsA: Match in regular expression with special REGEX symbols and line breaks
I will assume that the regex Flavour is similar to PHP, one of the most common. I will also assume that the escaped characters are line breaks, which the operator "." not capture, so you can use…
-
4
votes1
answer89
viewsA: regex to replace the $_POST['field'] string with $this->input->post('field') from codeigniter
Use that regex to capture the characters you want, separating them into 2 groups. \$_(.*?)\['(.*?)'\] In the substitution field use: $this->\L$2->$1\('\U$2\') Explanation: The first regex will…
-
0
votes2
answers57
viewsA: Selected language error
As cited by the user, the problem can be solved with include de clocale: #include <clocale>
-
13
votes2
answers1320
viewsQ: What are the differences between Kanban and Scrum?
It seems that nowadays it is impossible to work in programming and not know the agile methodologies developmental. I am aware that both are used to improve team performance and integration when…
-
5
votes1
answer90
viewsA: Insert 0 when you have 10 numbers
You must enter a capture group. So you can identify replace through the group and use it again with what you want to insert. I suggest you try to change your regex to: ^(\d{10})$ And use for…
-
2
votes2
answers107
viewsA: Get content that is before the number using regex
This regex will work, it captures all non-numeric content from the beginning of the line to the first occurrence of a digit. ^\D*(?=\d) Explanation: ^ indicates the start of the line. \D* makes…
-
7
votes1
answer222
viewsQ: Why is there no Lookbehind in Javascript?
I hear there’s no such thing as group Construct lookbehind in Regex’s made in Javascript then I appeared some doubts as: Because there is no? Is there any reason that makes it incompatible c/the…