I have this
"208 Wars 209 Xevious 210 Zooming Secrataries 211 Argus 212 DR PLUMBER 213 Goonies 214 KAGE LEGEND 215 Super Chinese 216 TWIN BEE 01 217 Star Soldier 218 BALLOON monster 219 TRACK FIELD 220 80 days"
Its a list of games and as you can see each game has number in front of it starting with 208 up to 220, I would manually have to go trough the list of 500 games and hit ENTER in front of each number to put it into a new line.
Can I somehow do this automatically ?
With any program, is fine with me.Notepad++, maybe Word,...
With Word, to insert ENTER in front of each number with three digits, search <[0-9]{3}> and replace all with ^l^& (line break followed by the found text) with pattern matching using the placeholders option.
Note that this fails if a game name contains a 3-digit number.
Related
I have a list of numbers that I would like to reformat, but I'm having difficulty with (I think) the substitution -- I'm capturing the groups as I intend to, but they aren't being rendered the way I expect them to be.
Here's some of the text:
Rear seal:
102
111
112
113
137
156
And the expected output is this:
Rear seal:
102 111 112
113 137 156
I'm using this regex to distinguish the first, second, and third lines:
(\d{3}[\n\r])(\d{3}[\n\r])(\d{3}[\n\r]) coupled with \1\t\2\t\3\n for the substitution. But for some reason it comes out as
Rear seal:
102
111
112
113
137
156
I'm using the excellent site regex101.com for testing, but I could use some human input. Specific link is
https://regex101.com/r/R7niEU/1 for this issue.
Thanks in advance.
You are capturing the newline in the capturing group. That way it will also be part of the replacement.
You can only capture the digits and match the newline instead.
Then replace with \1\t\2\t\3\n
(\d{3})[\n\r](\d{3})[\n\r](\d{3})[\n\r]
Regex demo
I have a document with hundreds or thousands of numbers. These are page references. The page references have now shifted, so I need to modify every reference.
Using regex in word advanced find and replace, I have tried:
[0-9]{1,}
While this does return each number, it will also then return the next 2 digits of a 3 digit number, which I want to avoid.
The numbers each have 2 or 3 digits and need to subtract 14 from each.
Example:
George V, 116
George Washington Memorial Parkway, 223
Georgian designs, 91, 196, 202; as unique 215
This should become:
George V, 102
George Washington Memorial Parkway, 209
Georgian designs, 77, 182, 188; as unique 203
The following should find all numbers in Word:
<[0-9]{1,}>
< and > represent the start and end of words.
I have list of number:
19
20
21
22
23
24
25
26
many more numbers...
I want to add one number to all of then as prefix so thay will all becam etree digit numbers:
219
220
221
222
223
224
225
226
It should go lik this in find section: \S{2,} than what should I put in replace section? 2$1 or what I em not expert.
Find all two digits and capture them (with parentheses).
\b(\d\d)\b
Replace captured groups with an additional 2 in front.
2$1
I want to recognize phone number as 9 consecutive figures which can be separated by white spaces, non-breaking spaces etc. with regEx "(\s*\d\s*){9}"
I run VBA macro (JS RegEx) and here are example strings which work fine with above RegEx:
ul. 27 Grudnia 16, tel. 21 287 31 61, fax 61 286 69 60 –
ul. Wrzosowa 110/120/222, kom. 692 601 428
And here is an example where phone number is not detected in VBA, but is detected by RegEx JS online tools:
al. Mazowieckiego 63, kom. 622 769 694 –
Strings which are detected and these which are not, have the same structure, so I have no idea why VBA doesn't detect phone number in some of them.
It came out that VBA changed some strings to look in - replaced a whitespace - chr(32) with a non breaking chr(160).
Removing chr(160) from string to look in solves the problem.
Also I will try to find RegEx which will let non-breaking spaces, because \s* doesn't do so, at least in VBA.
I am trying to write one regular express to search for a phone number similar to
011 (134) 1234567892.
The country code must only be 011. And the area code in () can be 134 132 131 138 136 or 137. The last 10 numbers can be random. I have this
((\<011[\-\. ])?(\(|\<)\d\d\d[\)\.\-/]?)?\<\d\d\d\d\d\d\d\d\d\d\>
but it is only giving me one result.
If any could please give me some help..that would be great! Thanks.
This one should work:
(011 \(13[124678]\) \d{10})
You can see working DEMO which shows couple of correct and incorrect inputs.
^011 \(13[124678]\) \d{10}$
seems to match all of the phone numbers I tried given your constraints
^ matches the start of string
011 matches only 011
\(13[124678]\) matches 134 132 131 138 136 or 137
\d{10} matches a digit using the digit character class exactly 10 times using the repeat N syntax {n}
/011 \(13[124678]\) \d{10}/g
Don't forget the g flag to match all the occurrences.