內特定字符串的內容我有一個大的字符串是這樣的:獲得大串
[/az_column_text][/vc_column_inner][vc_column_inner width="3/4"]
[az_latest_posts post_layout="listed-layout" post_columns_count="2clm" post_categories="assemblea-soci-2015"]
[/vc_column_inner][/vc_row_inner][/vc_column]
我需要提取什麼:
assemblea-soci-2015
當然這個值可以改變,也是大串也可以改變。我需要一個正則表達式或其他東西來從這個大字符串中提取這個值(它總是從post_categories="my-value-to-extract"
)。
我認爲採取post_categories="
作爲一個可能的子字符串的開始和下一個字符"
作爲我的部分結束,但不知道如何做到這一點。
有沒有一種優雅的方式來做到這一點也爲未來的價值,當然,不同的長度?
只需更換'如一個可能的子串和nex的開始這個'post_categories ='中的t char'作爲一個可能的子字符串的開始,下一個字符「'用'(。*?)' – sln