Main Area and Open Discussion > General Software Discussion
Regular Expressions (help)
Renegade:
You need to be explicit about where and how you need to use this. Expresso is an excellent program, and would certainly let you get the job done.
Contro:
You need to be explicit about where and how you need to use this. Expresso is an excellent program, and would certainly let you get the job done.
-Renegade (January 08, 2013, 07:31 PM)
--- End quote ---
Me or Robin ?
:-[
robinsiebler:
You, silly! I was quite specific. Why won't that program, or any of the others like it, work for you?
Contro:
:-\
I keep trying then.
:-*
4wd:
--- Code: AutoIt ---#Region ;**** Directives created by AutoIt3Wrapper_GUI ****#AutoIt3Wrapper_UseUpx=n#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;$inclip = "***CONTRO*** February 28, 2010 at 5:18am";$inclip = '01.02.2010.05.18' HotKeySet('^#!2', '_Doit') ; Win+Alt+Ctrl+2 While 1 Sleep(1000)WEnd Exit Func _Doit() $inclip = ClipGet() If StringLeft($inclip, 12) <> '***CONTRO***' Then $outclip = StringRegExpReplace($inclip, '(..)\.(..)\.(....)\.0?(.+)\.(..)', '\1_\2_\3 , \4_\5') Else $outclip = _Valmorphanize(StringMid($inclip, 14)) EndIf ClipPut($outclip) Sleep(50) Send('^v')EndFunc Func _Valmorphanize($temp) Local $hour = StringLeft(StringRight($temp, 7), StringInStr(StringRight($temp, 7), ':') - 1) + (12 * (StringRight(StringRight($temp, 7), 2) = 'pm')) If Not Mod($hour, 12) Then $hour-=12 Return StringRegExpReplace($temp, '.+\b.\d+, (\d{4}).+:(\d{2}).*', StringFormat('%02s', StringRegExpReplace(StringMid($temp, StringInStr($temp, ' ') + 1, 2), '([,\s])', '')) & '_' & StringFormat('%02s', Int(StringInStr('JanFebMarAprMayJunJulAugSepOctNovDec', StringLeft($temp, 3), 1) / 3) + 1) & '_\1 , ' & $hour & '_\2')EndFunc
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version