regexmatch.dev
Explore
Open main menu
Save & Share
Facebook
Twitter
Tumblr
E-Mail
Pinterest
LinkedIn
Reddit
Get path from any text
Published on Tue Mar 01 2022
get path (windows style) from any type of text (error message, e-mail corps ...) compatible PCRE, PCRE2, and so, AutoHotkey (just escape "%" in "`%")
Regex
Test String
C:/test\gvk.hv/fgfjgjj bdsdfus(fg) C:/test\gvkhv/../fgfjgjjb/ yfigfi C:/test\gvk.hv/fgfj.gjjb/uhloext C:/test\gvk.hv/fgfj.gjjb/uhloext.ds Site0 / 3: - Warning . See log file 'C:\ProgramData\InfoVista\Planet 7.4\7.4\RPE\Log\Plugins\Universal_Model_masked\log_Universal_Model.txt' for details C:/test\gvk.hv/fgfj.gjjb/uhloext.ds.yi : gf \\b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Polygon\Haguenau\Building\Haguenau hgtfhyt "C:/te-st.html" "C:/te-st.html" gd"dhbcsk "C:/te/dsst.ikpo fdsf "C: est" "C:// test.html" gd "//te s t/e, llo.html C:/test\f/uhlo/. C://te?st.html b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Custom Data" ; dfsdf "\\b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Custom Data" ; dfsdf "\\ Haguenau_Building.tab : Data format of \\b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Polygon\Haguenau\Building\Haguenau Building.* C: is invalid Haguenau_Building.tab : Data format of \\b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Polygon\Haguenau\Building\Haguenau Building.TAB, is invalid Haguenau_Building.tab : Data format of \\b-renice\sauvegardes\B-HIER\GEO\Geo_NetAct_Atoll_Planet\UR_Est\Polygon\Haguenau\Building\Haguenau Buildi* ng.*, is invalid C:/test/../hjgbkl C:/test/../hjgbkl.gfgdfgrdgfdgr C:/test/../hjgbkl C:/test.html C://test/ .h/hel,lo.html//test/./hello.html C:/test//hello.html //test //hello.html /test "%tmp%/fsdfs" %tmp%/fsdfs ERROR 8/31/2021 - 6:45:39 PM HighResClutter .RasterFile : \\b-ren ice\sauv egardes\B-HIER\GEO%dsq%\NewJersey_NewYork\DTM\DTM\CENTRAL_JERSE..Y_New_York_2 m_Z18N_0_DTM_02_06.bil : Le fichier spécifié est introuvable. \\b-ren ice\sauv egardes\..\B-HIER\GEO\NewJersey_NewYork\DTM\DTM\CENTRAL_JERSE..Y_New_York_2 m_Z18N_0_DTM_02_06.bil C:\b-ren ice\sauv egardes\B-HIER\GEO\NewJersey_NewYork\DTM\DTM\CENTRAL_JERSE..Y_New_York_2 m_Z18N_0_DTM_02_06.bil \\b-ren ice\sauv egardes\B-HIER\GEO\NewJersey_NewYork\DTM\DTM\CENTRAL_JER SE.Y_New_York_2 m_Z18N_0_DTM_02_06.bil. //test.html \\10.1.1.107 //10.1.1.107/test.html //10.1.1.107/te st/hello.html //10.1.1.107/test/hello //test/hello.txt //test/hello.txt. /test/html /tes?t/html /test.html test.html // / \\\\ \\ /t!esrtr C:/hel**o
Additional matching regexes for
Get path from any text
Get path from any text
get path (windows style) from any type of text (error message, e-mail corps ...) compatible PCRE, PCRE2, and so, AutoHotkey (just escape "%" in "`%")
Url
Port https://regex101.com/library/cX0pJ8 to PCRE2 (PHP >= 7.3)
Gitlab - Commit message
Commit message for Gitlab's Push Rules
Escape Special Characters
Escapes special characters. Reference: http://www.php.net/manual/en/function.mysql-real-escape-string.php
Apache ErrorLog Parsing
Parse Apache Error Log Line (in default format). Example: [Wed Jun 01 20:05:21.194671 2016] [core:error] [pid 40699] [client ::1:64519] PHP Parse error: syntax error, unexpected '$t' (T_VARIABLE) in /Projects/trunk/code/php/test.php on line 16
outer Parentheses
Finds the outermost pair of parentheses. Compatible with any amount of nesting
nginx log parser
separate nginx log into database table-style fields
Cisco FastEthernet Ports 13-24
This regex captures Cisco-style FastEthernet ports 13-24
Match a URL from a text message
I use this to match the first url present in a text message.
MySQL Full-Text BOOLEAN mode
Checks if an input string is compatible with the BOOLEAN mode of MySQL full text search system