[Solved] Extract all numbers in brackets with Python [closed]

Regex can do that: s = “asd[123]348dsdk[45]sdhj71[6789]sdfh” import re s_filter=” “.join(re.findall(r”\[(\d+)\]”,s))) print(s_filter) Output: 123 45 6789 Pattern explained: \[ \] are the literal square brackets (\d+?) as as few numbers inside them as capture group re.findall finds them all and ‘ ‘.join(iterable)combines them back into a string. 2 solved Extract all numbers in brackets with … Read more

[Solved] Copying a variable contained in cell into another cell

Try the code below, explanations inside the code’s comments: Option Explicit Sub ExtractAfterShowOnly() Dim WordsArr() As String Dim i As Long Dim MatchString As String ‘ use Split to read each section between “https://stackoverflow.com/” as arra element WordsArr = Split(Range(“A2”).Value2, “https://stackoverflow.com/”) ‘ loop through array For i = 1 To UBound(WordsArr) ‘ if there’s a … Read more