So, the concept is to find out if inside an href there is the site name (so that I can understand that it is an internal link) and that it contains the rel="noopener".
I have adapted the regex to the best, modifying it like this:
www.sito.it. * rel = "noopener"
and removing the https: // protocol which can generate errors.
Unfortunately, however, something is still wrong. I state that the regex I need for a seo spider (ScreamingFrog), in which it is possible to set the targeted regex for searches within a website.
I tried but all links containing rel noopener are searched. I'm interested in searching for internal links only, and can be recognized by the name of the site in the link. For example, if the site is https://www.sitoprova.it, in href there must be the name of the site at the beginning of the link, i.e.
With the sample text-strings you've provided, its impossible for any expression to match by 'internal' domain.
If your application has a %variable% to represent the domain being searched, you would have to provide this.
Regex simply matches text, it cant determine if that text is "the domain being searched" by your application.
I've seen apps that support variables like %domain% in their match-expressions, but they're specific to that application.
So if your app supports this, you'd have to look up the variable-name in the documentation, to provide a working example.
Short of that, you would need to either hard-code the domains per site being searched, like in the example provided.
Or include a larger snippet of the html, but only if the html offered another way to verify 'internal' (highly unlikely).
Sorry for the news, but regex wont solve this without 'internal' being defined, whether by a previous match, or by some variable.
Some apps even let you customize variables, so maybe thats another option? Sorry, but I know nothing of this "Screaming Frog".
Either way, I do wish you luck!
The commonest way that people solve this for browsers that don't support this is to think in reverse. In other words, you reverse the string and the regular expression so that all you end up testing is the negative regular expression, rather than a lookbehind. This[^] is a great resource.
My Customer number is in the pattern : 88765
ie. 5 digits alone...
using regex i have to validate if there are any characters and special characters in the customer number. Incase there are any characters (eg: 8AB90) or special characters then my string is invalid.
Please help me with the RegEx for the same.
I have a question on regex: Is it possible to match for certain characters (and replace them) in only a part of a string? E. g.
str="I want to solve this problem"
I now want to match all spaces after the first occurence of the letter, say, "v". I know I can filter the whole part of the string after (and including) the first v with the regex "v.*", but how to match the spaces only in that part?
Thanks, Richard, for your answer!
So, if I understand correctly, your code splits the string into 3 parts, the first part being everything until the first space after the first "v", the other parts being the rest of the string split by spaces. I am sure that will work.
Well, what I was looking for - this is a more theoretical and general question - is there an operator you can use in regexes which does something like "apply the following only to the previously matched part"? For example:
Explanation: The first part of the regex is "v.*" which means: Match the part of the string after the first v. The second part is "c", which will match every c. Now, is there an operator (here symolized by #) between the 2 parts of the regex, which means: "Apply the part after this operator ("c") to the result of the part before the operator ("v.*)"? It is like: Do a secondary match inside the primary match.
Sorry, English is not my native language, but I still hope, I could make my point clear.
Last Visit: 31-Dec-99 18:00 Last Update: 16-May-22 2:32