adding one space between year

A swapping-ground for Regular Expression syntax

adding one space between year

Postby Peter35 » Tue May 03, 2016 4:45 pm

Hello
I need Your help, I was trying to do it myself but I failed
I need to add one space between trailing 4 numbers like 1999 or 2012

before
some text here 2012 some text here (the number of text before and after year is always different)

after
some text here 20 12 some text here

Is it possible at all

Anyway Thanks for Your help.

Best Regards
Peter35
 
Posts: 2
Joined: Tue May 03, 2016 4:39 pm

Re: adding one space between year

Postby Admin » Wed May 04, 2016 12:55 am

Try RegEx (1):

Match:
(.*)(\d)(\d)(\d)(\d)(.*)

Replace:
\1\2\3 \4\5\6

thanks
Admin
Site Admin
 
Posts: 1506
Joined: Tue Mar 08, 2005 8:39 pm

Re: adding one space between year

Postby Admin » Wed May 04, 2016 12:56 am

BTW it works if you do not have other numbers in name.
Admin
Site Admin
 
Posts: 1506
Joined: Tue Mar 08, 2005 8:39 pm

Re: adding one space between year

Postby Peter35 » Wed May 04, 2016 9:44 am

Thank You very much it is working
Peter35
 
Posts: 2
Joined: Tue May 03, 2016 4:39 pm


Return to Regular Expressions


cron